Fix NPE when first start
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user