mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-21 15:28:52 -05:00
Fix NPE
This commit is contained in:
parent
b960432c52
commit
a029bdf94c
@ -48,12 +48,16 @@ public enum XEM {
|
||||
public String getSeriesName(Map<String, List<String>> n, Integer s) {
|
||||
switch (this) {
|
||||
case AniDB:
|
||||
return s == null ? null : n.get(Integer.toString(s)).get(0);
|
||||
return s == null ? null : first(n.get(String.valueOf(s)));
|
||||
default:
|
||||
return n.get("all").get(0);
|
||||
return first(n.get("all"));
|
||||
}
|
||||
}
|
||||
|
||||
private String first(List<String> values) {
|
||||
return values == null || values.isEmpty() ? null : values.get(0);
|
||||
}
|
||||
|
||||
protected final Resource<Set<Integer>> haveMap = Resource.lazy(this::getHaveMap);
|
||||
|
||||
public Optional<Episode> map(Episode episode, XEM destination) throws Exception {
|
||||
|
Loading…
Reference in New Issue
Block a user