Fix NPE when first start

This commit is contained in:
huanghongxun
2018-09-19 00:20:32 +08:00
parent b1cd7057db
commit 61ab8a6769

View File

@@ -99,11 +99,13 @@ public final class MainPage extends StackPane implements DecoratorPage {
Profiles.selectedProfileProperty().addListener((a, b, newValue) -> profile = newValue);
profile = Profiles.getSelectedProfile();
if (profile != null) {
if (profile.getRepository().isLoaded())
loadVersions(profile.getRepository());
else
profile.getRepository().refreshVersionsAsync().start();
}
}
private void loadVersions(HMCLGameRepository repository) {
List<IconedMenuItem> children = repository.getVersions().parallelStream()