mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-18 08:16:58 -04:00
Suppress NPE
This commit is contained in:
parent
cf6b735026
commit
2a44167c22
@ -475,8 +475,12 @@ public final class LauncherHelper {
|
|||||||
switch (launcherVisibility) {
|
switch (launcherVisibility) {
|
||||||
case HIDE_AND_REOPEN:
|
case HIDE_AND_REOPEN:
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
|
// If application was stopped and execution services did not finish termination,
|
||||||
|
// these codes will be executed.
|
||||||
|
if (Controllers.getStage() != null) {
|
||||||
Controllers.getStage().hide();
|
Controllers.getStage().hide();
|
||||||
emitStatus(LoadingState.DONE);
|
emitStatus(LoadingState.DONE);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case CLOSE:
|
case CLOSE:
|
||||||
@ -489,8 +493,12 @@ public final class LauncherHelper {
|
|||||||
break;
|
break;
|
||||||
case HIDE:
|
case HIDE:
|
||||||
Platform.runLater(() -> {
|
Platform.runLater(() -> {
|
||||||
|
// If application was stopped and execution services did not finish termination,
|
||||||
|
// these codes will be executed.
|
||||||
|
if (Controllers.getStage() != null) {
|
||||||
Controllers.getStage().close();
|
Controllers.getStage().close();
|
||||||
emitStatus(LoadingState.DONE);
|
emitStatus(LoadingState.DONE);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user