resolve NPE on shutdown before account opened

This commit is contained in:
woodser 2022-04-27 12:24:26 -04:00
parent 716f62797d
commit d87c679f4c

View file

@ -104,10 +104,14 @@ public class HavenoHeadlessApp implements HeadlessApp {
public void stop() { public void stop() {
if (!shutDownRequested) { if (!shutDownRequested) {
UserThread.runAfter(() -> { UserThread.runAfter(() -> {
gracefulShutDownHandler.gracefulShutDown(() -> { if (gracefulShutDownHandler != null) {
log.debug("App shutdown complete"); gracefulShutDownHandler.gracefulShutDown(() -> {
if (onGracefulShutDownHandler != null) onGracefulShutDownHandler.run(); log.debug("App shutdown complete");
}); if (onGracefulShutDownHandler != null) onGracefulShutDownHandler.run();
});
} else if (onGracefulShutDownHandler != null) {
onGracefulShutDownHandler.run();
}
}, 200, TimeUnit.MILLISECONDS); }, 200, TimeUnit.MILLISECONDS);
shutDownRequested = true; shutDownRequested = true;
} }