mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 15:26:27 -04: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) {
|
public Image getVersionIconImage(String id) {
|
||||||
if (id == null)
|
if (id == null || !isLoaded())
|
||||||
return new Image("/assets/img/grass.png");
|
return new Image("/assets/img/grass.png");
|
||||||
|
|
||||||
Version version = getVersion(id);
|
Version version = getVersion(id);
|
||||||
|
@ -40,7 +40,6 @@ public class DefaultGameRepository implements GameRepository {
|
|||||||
|
|
||||||
private File baseDirectory;
|
private File baseDirectory;
|
||||||
protected Map<String, Version> versions;
|
protected Map<String, Version> versions;
|
||||||
protected boolean loaded = false;
|
|
||||||
|
|
||||||
public DefaultGameRepository(File baseDirectory) {
|
public DefaultGameRepository(File baseDirectory) {
|
||||||
this.baseDirectory = baseDirectory;
|
this.baseDirectory = baseDirectory;
|
||||||
@ -251,7 +250,6 @@ public class DefaultGameRepository implements GameRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.versions = versions;
|
this.versions = versions;
|
||||||
loaded = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -357,7 +355,7 @@ public class DefaultGameRepository implements GameRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isLoaded() {
|
public boolean isLoaded() {
|
||||||
return loaded;
|
return versions != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public File getModpackConfiguration(String version) {
|
public File getModpackConfiguration(String version) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user