Fix javafx error on ci

This commit is contained in:
Zhi You Tan
2017-08-14 11:02:07 +12:00
parent 2093e79b6a
commit e780b47160
@@ -145,12 +145,14 @@ public class ClientToServerThread implements Runnable {
} }
} catch (ByteReadException e) { } catch (ByteReadException e) {
closeSocket(); closeSocket();
if (Platform.isFxApplicationThread()) {
Platform.runLater(() -> { Platform.runLater(() -> {
Alert alert = new Alert(AlertType.ERROR); Alert alert = new Alert(AlertType.ERROR);
alert.setHeaderText("Host has disconnected"); alert.setHeaderText("Host has disconnected");
alert.setContentText("Cannot find Server"); alert.setContentText("Cannot find Server");
alert.showAndWait(); alert.showAndWait();
}); });
}
clientLog(e.getMessage(), 1); clientLog(e.getMessage(), 1);
return; return;
} }