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) {
|
||||
for (String it : terms) {
|
||||
String key = keyFunction.apply(it);
|
||||
if (key.length() > 0 && !uniqueMap.containsKey(key)) {
|
||||
uniqueMap.put(key, valueFunction.apply(it));
|
||||
for (String term : terms) {
|
||||
if (term != null && term.length() > 0) {
|
||||
String key = keyFunction.apply(term);
|
||||
if (key != null && key.length() > 0 && !uniqueMap.containsKey(key)) {
|
||||
uniqueMap.put(key, valueFunction.apply(term));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue