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);
|
Profiles.selectedProfileProperty().addListener((a, b, newValue) -> profile = newValue);
|
||||||
|
|
||||||
profile = Profiles.getSelectedProfile();
|
profile = Profiles.getSelectedProfile();
|
||||||
|
if (profile != null) {
|
||||||
if (profile.getRepository().isLoaded())
|
if (profile.getRepository().isLoaded())
|
||||||
loadVersions(profile.getRepository());
|
loadVersions(profile.getRepository());
|
||||||
else
|
else
|
||||||
profile.getRepository().refreshVersionsAsync().start();
|
profile.getRepository().refreshVersionsAsync().start();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void loadVersions(HMCLGameRepository repository) {
|
private void loadVersions(HMCLGameRepository repository) {
|
||||||
List<IconedMenuItem> children = repository.getVersions().parallelStream()
|
List<IconedMenuItem> children = repository.getVersions().parallelStream()
|
||||||
|
|||||||
Reference in New Issue
Block a user