mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-22 15:58:52 -05:00
Fix NPE caused by series name being null
This commit is contained in:
parent
22a9f01760
commit
af498ecd47
@ -13,6 +13,7 @@ import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.function.Function;
|
||||
|
||||
@ -154,7 +155,8 @@ public class EpisodeMatcher extends Matcher<File, Object> {
|
||||
|
||||
// check drill-down integrity
|
||||
return stream(episodes).skip(1).allMatch(e -> {
|
||||
return episodes[0].getSeriesName().equals(e.getSeriesName());
|
||||
// do an equals check but account for null values
|
||||
return Objects.equals(episodes[0].getSeriesName(), e.getSeriesName());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -192,6 +192,11 @@ public class TheTVDBClient extends AbstractEpisodeListProvider implements Artwor
|
||||
return fetchSeriesData(series, sortOrder, DEFAULT_LOCALE);
|
||||
}
|
||||
|
||||
// if series name isn't even available in English then just use whatever value we've got
|
||||
if (info.getName() == null) {
|
||||
info.setName(series.getName());
|
||||
}
|
||||
|
||||
// fetch episode data
|
||||
List<Episode> episodes = new ArrayList<Episode>();
|
||||
List<Episode> specials = new ArrayList<Episode>();
|
||||
|
Loading…
Reference in New Issue
Block a user