Skip to content

Commit e323a3c

Browse files
committed
coderabbit säkerthetsfeedback
1 parent 1d1a4b2 commit e323a3c

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

src/main/java/com/example/FxUtils.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
public class FxUtils {
66

7-
/**
8-
* Execute task on FX-thread if possible, otherwise inline.
9-
*/
10-
static void runOnFx(Runnable task) {
7+
public static void runOnFx(Runnable task) {
118
try {
12-
if (Platform.isFxApplicationThread()) task.run();
13-
else Platform.runLater(task);
9+
if (Platform.isFxApplicationThread()) {
10+
task.run();
11+
} else {
12+
Platform.runLater(task);
13+
}
1414
} catch (IllegalStateException notInitialized) {
15+
//headless
1516
task.run();
1617
}
1718
}

0 commit comments

Comments
 (0)