Suppress NPE
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
package org.jackhuang.hmcl.game;
|
package org.jackhuang.hmcl.game;
|
||||||
|
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
|
import javafx.stage.Stage;
|
||||||
import org.jackhuang.hmcl.Launcher;
|
import org.jackhuang.hmcl.Launcher;
|
||||||
import org.jackhuang.hmcl.auth.Account;
|
import org.jackhuang.hmcl.auth.Account;
|
||||||
import org.jackhuang.hmcl.auth.AuthInfo;
|
import org.jackhuang.hmcl.auth.AuthInfo;
|
||||||
@@ -398,7 +399,10 @@ public final class LauncherHelper {
|
|||||||
private void checkExit() {
|
private void checkExit() {
|
||||||
switch (launcherVisibility) {
|
switch (launcherVisibility) {
|
||||||
case HIDE_AND_REOPEN:
|
case HIDE_AND_REOPEN:
|
||||||
Platform.runLater(Controllers.getStage()::show);
|
Platform.runLater(() -> {
|
||||||
|
Optional.ofNullable(Controllers.getStage())
|
||||||
|
.ifPresent(Stage::show);
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
case KEEP:
|
case KEEP:
|
||||||
// No operations here
|
// No operations here
|
||||||
|
|||||||
Reference in New Issue
Block a user