Fix not on FX thread
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
package org.jackhuang.hmcl.setting;
|
package org.jackhuang.hmcl.setting;
|
||||||
|
|
||||||
import com.google.gson.*;
|
import com.google.gson.*;
|
||||||
|
import com.jfoenix.concurrency.JFXUtilities;
|
||||||
import javafx.application.Platform;
|
import javafx.application.Platform;
|
||||||
import javafx.beans.InvalidationListener;
|
import javafx.beans.InvalidationListener;
|
||||||
import javafx.beans.Observable;
|
import javafx.beans.Observable;
|
||||||
@@ -146,6 +147,7 @@ public final class Profile implements Observable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void checkSelectedVersion() {
|
private void checkSelectedVersion() {
|
||||||
|
JFXUtilities.runInFX(() -> {
|
||||||
if (!repository.isLoaded()) return;
|
if (!repository.isLoaded()) return;
|
||||||
String newValue = selectedVersion.get();
|
String newValue = selectedVersion.get();
|
||||||
if (!repository.hasVersion(newValue)) {
|
if (!repository.hasVersion(newValue)) {
|
||||||
@@ -155,6 +157,7 @@ public final class Profile implements Observable {
|
|||||||
else if (newValue != null)
|
else if (newValue != null)
|
||||||
selectedVersion.setValue(null);
|
selectedVersion.setValue(null);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public HMCLGameRepository getRepository() {
|
public HMCLGameRepository getRepository() {
|
||||||
|
|||||||
Reference in New Issue
Block a user