mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-01-30 14:39:56 +08:00
Conceal NPE
This commit is contained in:
parent
5a0e17b121
commit
48d98b2424
@ -150,7 +150,7 @@ public class HMCLGameRepository extends DefaultGameRepository {
|
||||
}
|
||||
|
||||
public Image getVersionIconImage(String id) {
|
||||
if (id == null)
|
||||
if (id == null || !isLoaded())
|
||||
return new Image("/assets/img/grass.png");
|
||||
|
||||
Version version = getVersion(id);
|
||||
|
@ -40,7 +40,6 @@ public class DefaultGameRepository implements GameRepository {
|
||||
|
||||
private File baseDirectory;
|
||||
protected Map<String, Version> versions;
|
||||
protected boolean loaded = false;
|
||||
|
||||
public DefaultGameRepository(File baseDirectory) {
|
||||
this.baseDirectory = baseDirectory;
|
||||
@ -251,7 +250,6 @@ public class DefaultGameRepository implements GameRepository {
|
||||
}
|
||||
|
||||
this.versions = versions;
|
||||
loaded = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -357,7 +355,7 @@ public class DefaultGameRepository implements GameRepository {
|
||||
}
|
||||
|
||||
public boolean isLoaded() {
|
||||
return loaded;
|
||||
return versions != null;
|
||||
}
|
||||
|
||||
public File getModpackConfiguration(String version) {
|
||||
|
Loading…
Reference in New Issue
Block a user