Fix potential NPE
@see https://www.filebot.net/forums/viewtopic.php?f=6&t=4234&p=23851#p23851
This commit is contained in:
parent
d7215de8c5
commit
23542c58c5
|
@ -966,10 +966,12 @@ public class MediaDetection {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void addUniqueQuerySet(Collection<String> terms, Function<String, String> keyFunction, Function<String, String> valueFunction, Map<String, String> uniqueMap) {
|
private static void addUniqueQuerySet(Collection<String> terms, Function<String, String> keyFunction, Function<String, String> valueFunction, Map<String, String> uniqueMap) {
|
||||||
for (String it : terms) {
|
for (String term : terms) {
|
||||||
String key = keyFunction.apply(it);
|
if (term != null && term.length() > 0) {
|
||||||
if (key.length() > 0 && !uniqueMap.containsKey(key)) {
|
String key = keyFunction.apply(term);
|
||||||
uniqueMap.put(key, valueFunction.apply(it));
|
if (key != null && key.length() > 0 && !uniqueMap.containsKey(key)) {
|
||||||
|
uniqueMap.put(key, valueFunction.apply(term));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue