Fix NPE when downloading libs.

This commit is contained in:
modmuss50 2017-04-05 13:23:06 +01:00
parent 4059979e21
commit 6dbe4d7271
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82

View file

@ -83,7 +83,11 @@ public class Version {
if (natives == null) {
return "";
} else {
return "-" + natives.get(OperatingSystem.getOS().replace("${arch}", OperatingSystem.getArch())).getAsString().replace("\"", "");
JsonElement element = natives.get(OperatingSystem.getOS().replace("${arch}", OperatingSystem.getArch()));
if(element == null){
return "";
}
return "-" + element.getAsString().replace("\"", "");
}
}