From 215e54f1abfe36d594e69b8ac336f1ad01b70568 Mon Sep 17 00:00:00 2001 From: Viktor Kolomeyko Date: Fri, 18 May 2018 11:09:02 +0100 Subject: [PATCH] ENT-1902: If we are already in the JavaFX thread - perform direct invocation without postponing it. (#3177) Or else if we are operating in JavaFX thread the sequence of invocations will change. --- .../main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt index a49785a101..f69e12e272 100644 --- a/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt +++ b/client/jfx/src/main/kotlin/net/corda/client/jfx/model/NodeMonitorModel.kt @@ -70,7 +70,8 @@ class NodeMonitorModel { // Only execute using "runLater()" if JavaFX been initialized. // It may not be initialized in the unit test. - if(initialized.value.get()) { + // Also if we are already in the JavaFX thread - perform direct invocation without postponing it. + if(initialized.value.get() && !Platform.isFxApplicationThread()) { Platform.runLater(op) } else { op()