1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-23 16:28:51 -05:00

Fix potential NPE

@see https://www.filebot.net/forums/viewtopic.php?f=6&t=4234&p=23851#p23851
This commit is contained in:
Reinhard Pointner 2016-10-17 02:41:33 +08:00
parent 23542c58c5
commit 32a1d60e7b

View File

@ -969,8 +969,8 @@ public class MediaDetection {
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));
if (key != null && key.length() > 0) {
uniqueMap.computeIfAbsent(key, k -> valueFunction.apply(term));
}
}
}