From d87c679f4c5378ce9b9faac3bba5b6ef86616182 Mon Sep 17 00:00:00 2001 From: woodser Date: Wed, 27 Apr 2022 12:24:26 -0400 Subject: [PATCH] resolve NPE on shutdown before account opened --- .../main/java/bisq/core/app/HavenoHeadlessApp.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/bisq/core/app/HavenoHeadlessApp.java b/core/src/main/java/bisq/core/app/HavenoHeadlessApp.java index 832888a642..62c1eca08b 100644 --- a/core/src/main/java/bisq/core/app/HavenoHeadlessApp.java +++ b/core/src/main/java/bisq/core/app/HavenoHeadlessApp.java @@ -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; }