Workaround fix for NPE when remove mods

This commit is contained in:
huanghongxun
2019-04-25 10:49:25 +08:00
parent ee466d0f4c
commit 9ed14b227b

View File

@@ -41,6 +41,7 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Objects;
import java.util.logging.Level;
import java.util.stream.Collectors;
@@ -142,6 +143,7 @@ public final class ModListPage extends ListPageBase<ModListPageSkin.ModInfoObjec
try {
modManager.removeMods(selectedItems.stream()
.map(TreeItem::getValue)
.filter(Objects::nonNull)
.map(ModListPageSkin.ModInfoObject::getModInfo)
.toArray(ModInfo[]::new));
loadMods(modManager);