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() {
if (!shutDownRequested) {
UserThread.runAfter(() -> {
gracefulShutDownHandler.gracefulShutDown(() -> {
log.debug("App shutdown complete");
if (onGracefulShutDownHandler != null) onGracefulShutDownHandler.run();
});
if (gracefulShutDownHandler != null) {
gracefulShutDownHandler.gracefulShutDown(() -> {
log.debug("App shutdown complete");
if (onGracefulShutDownHandler != null) onGracefulShutDownHandler.run();
});
} else if (onGracefulShutDownHandler != null) {
onGracefulShutDownHandler.run();
}
}, 200, TimeUnit.MILLISECONDS);
shutDownRequested = true;
}