From be945fe3ee49b8b4d4e6a33bc4ddbb932380bb27 Mon Sep 17 00:00:00 2001 From: kske Date: Sun, 20 Sep 2020 09:55:07 +0200 Subject: [PATCH] Fix threading issue in handshake rejection alert --- .../src/main/java/envoy/client/ui/controller/LoginScene.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/envoy/client/ui/controller/LoginScene.java b/client/src/main/java/envoy/client/ui/controller/LoginScene.java index 285f3de..30cb205 100644 --- a/client/src/main/java/envoy/client/ui/controller/LoginScene.java +++ b/client/src/main/java/envoy/client/ui/controller/LoginScene.java @@ -3,6 +3,7 @@ package envoy.client.ui.controller; import java.time.Instant; import java.util.logging.*; +import javafx.application.Platform; import javafx.fxml.FXML; import javafx.geometry.Insets; import javafx.scene.control.*; @@ -126,5 +127,5 @@ public final class LoginScene implements EventListener { } @Event - private void onHandshakeRejection(HandshakeRejection evt) { new Alert(AlertType.ERROR, evt.get()).showAndWait(); } + private void onHandshakeRejection(HandshakeRejection evt) { Platform.runLater(() -> new Alert(AlertType.ERROR, evt.get()).showAndWait()); } }