Fix NPE when in a mod loader dev env
parent
b955affb1a
commit
32837d71eb
|
@ -42,6 +42,7 @@ import org.w3c.dom.Element;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
|
|
||||||
import net.fabricmc.loom.LoomGradleExtension;
|
import net.fabricmc.loom.LoomGradleExtension;
|
||||||
|
import net.fabricmc.loom.configuration.InstallerData;
|
||||||
import net.fabricmc.loom.util.OperatingSystem;
|
import net.fabricmc.loom.util.OperatingSystem;
|
||||||
|
|
||||||
public class RunConfig {
|
public class RunConfig {
|
||||||
|
@ -207,7 +208,13 @@ public class RunConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getMainClass(String side, LoomGradleExtension extension, String defaultMainClass) {
|
private static String getMainClass(String side, LoomGradleExtension extension, String defaultMainClass) {
|
||||||
JsonObject installerJson = extension.getInstallerData().installerJson();
|
InstallerData installerData = extension.getInstallerData();
|
||||||
|
|
||||||
|
if (installerData == null) {
|
||||||
|
return defaultMainClass;
|
||||||
|
}
|
||||||
|
|
||||||
|
JsonObject installerJson = installerData.installerJson();
|
||||||
|
|
||||||
if (installerJson != null && installerJson.has("mainClass")) {
|
if (installerJson != null && installerJson.has("mainClass")) {
|
||||||
JsonElement mainClassJson = installerJson.get("mainClass");
|
JsonElement mainClassJson = installerJson.get("mainClass");
|
||||||
|
|
Loading…
Reference in New Issue