Fix missing null checking. (#2512)

This commit is contained in:
ZekerZhayard
2023-09-12 23:15:44 +08:00
committed by GitHub
parent 50173a3987
commit 833ac2e32e

View File

@@ -188,7 +188,7 @@ public final class ModListPage extends ListPageBase<ModListPageSkin.ModInfoObjec
return null; return null;
}) })
.whenComplete(Schedulers.javafx(), (result, exception) -> { .whenComplete(Schedulers.javafx(), (result, exception) -> {
if (exception != null) { if (exception != null || result == null) {
Controllers.dialog("Failed to check updates", "failed", MessageDialogPane.MessageType.ERROR); Controllers.dialog("Failed to check updates", "failed", MessageDialogPane.MessageType.ERROR);
} else if (result.isEmpty()) { } else if (result.isEmpty()) {
Controllers.dialog(i18n("mods.check_updates.empty")); Controllers.dialog(i18n("mods.check_updates.empty"));