From 030d54bc5cc374e1506cc50595a5b1007bd60ae8 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Sun, 16 Feb 2020 22:54:59 +0800 Subject: [PATCH] fix: not on FX thread. Mentioned in #673. --- .../org/jackhuang/hmcl/util/CrashReporter.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/util/CrashReporter.java b/HMCL/src/main/java/org/jackhuang/hmcl/util/CrashReporter.java index 553cc73f9..d78d5e3ed 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/util/CrashReporter.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/util/CrashReporter.java @@ -121,15 +121,16 @@ public class CrashReporter implements Thread.UncaughtExceptionHandler { " JVM Free Memory: " + Runtime.getRuntime().freeMemory() + "\n"; LOG.log(Level.SEVERE, text); - - if (checkThrowable(e)) { - if (showCrashWindow) { - Platform.runLater(() -> new CrashWindow(text).show()); + Platform.runLater(() -> { + if (checkThrowable(e)) { + if (showCrashWindow) { + new CrashWindow(text).show(); + } + if (!UpdateChecker.isOutdated() && IntegrityChecker.isSelfVerified()) { + reportToServer(text); + } } - if (!UpdateChecker.isOutdated() && IntegrityChecker.isSelfVerified()) { - reportToServer(text); - } - } + }); } catch (Throwable handlingException) { LOG.log(Level.SEVERE, "Unable to handle uncaught exception", handlingException); }