From 584e552e9078a792aac47c2937867bee0b6b9863 Mon Sep 17 00:00:00 2001 From: lukasz Date: Wed, 9 Oct 2019 17:58:21 +0200 Subject: [PATCH] Refactor BisqApp - update error popup message build --- desktop/src/main/java/bisq/desktop/app/BisqApp.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/app/BisqApp.java b/desktop/src/main/java/bisq/desktop/app/BisqApp.java index fed66ca5f9e..37da8583054 100644 --- a/desktop/src/main/java/bisq/desktop/app/BisqApp.java +++ b/desktop/src/main/java/bisq/desktop/app/BisqApp.java @@ -73,6 +73,7 @@ import java.awt.GraphicsEnvironment; import java.awt.Rectangle; +import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.function.Consumer; @@ -180,12 +181,10 @@ public void handleUncaughtException(Throwable throwable, boolean doShutDown) { try { try { if (!popupOpened) { - String message = throwable.getMessage(); popupOpened = true; - if (message != null) - new Popup<>().error(message).onClose(() -> popupOpened = false).show(); - else - new Popup<>().error(throwable.toString()).onClose(() -> popupOpened = false).show(); + new Popup<>().error(Objects.requireNonNullElse(throwable.getMessage(), throwable.toString())) + .onClose(() -> popupOpened = false) + .show(); } } catch (Throwable throwable3) { log.error("Error at displaying Throwable.");