Fixed NullPointerException when fail to get forge list.

This commit is contained in:
huangyuhui
2017-01-20 12:44:14 +08:00
parent da2f0b234f
commit db4615a2d3
3 changed files with 11 additions and 7 deletions

View File

@@ -42,7 +42,7 @@ public class InstallerPanel extends Page {
/**
* Creates new form InstallerPanel
*
* @param gsp To get the minecraft version
* @param gsp To get the minecraft version
* @param installerType load which installer
*/
public InstallerPanel(GameSettingsPanel gsp, InstallerType installerType) {
@@ -122,7 +122,11 @@ public class InstallerPanel extends Page {
InstallerType id;
Task refreshVersionsTask() {
return list.refresh(new String[] { gsp.getMinecraftVersionFormatted() }).after(new TaskRunnable(this::loadVersions));
Task t = list.refresh(new String[] { gsp.getMinecraftVersionFormatted() });
if (t != null)
return t.after(new TaskRunnable(this::loadVersions));
else
return null;
}
public synchronized InstallerVersionList.InstallerVersion getVersion(int idx) {