Fix potential NPE issue

Signed-off-by: Taylor Smock <taylor.smock@kaart.com>
pull/1/head v0.3.2
Taylor Smock 2019-12-19 07:47:07 -07:00
rodzic 23deedaffb
commit 2ad187a374
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 625F6A74A3E4311A
1 zmienionych plików z 3 dodań i 2 usunięć

Wyświetl plik

@ -163,8 +163,9 @@ public class MapWithAIAddCommand extends Command implements Runnable {
public Collection<String> getSourceTags() {
return sources.entrySet().parallelStream()
.filter(entry -> !editable.getPrimitiveById(entry.getKey()).isDeleted()).map(Entry::getValue)
.filter(Objects::nonNull).distinct().sorted().collect(Collectors.toList());
.filter(entry -> editable.getPrimitiveById(entry.getKey()) != null
&& !editable.getPrimitiveById(entry.getKey()).isDeleted())
.map(Entry::getValue).filter(Objects::nonNull).distinct().sorted().collect(Collectors.toList());
}
@Override