Skip to content
This repository has been archived by the owner on Jan 24, 2022. It is now read-only.

Commit

Permalink
Merge pull request #7 from gharris1727/fix-npe
Browse files Browse the repository at this point in the history
Fix NPE when natives object is incomplete.
  • Loading branch information
comp500 authored Aug 3, 2020
2 parents 4c6de88 + 68fd8c8 commit 92a007a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public MetadataResolutionResult resolve(MetadataCacheHelper.MetadataCacheView ca

JsonObject downloadsObj = libObj.getAsJsonObject("downloads");
JsonObject nativesObj = libObj.getAsJsonObject("natives");
if (nativesObj != null) {
if (nativesObj != null && nativesObj.has(currentOS)) {
// TODO: should natives be ignored anyway? - we don't/can't handle them properly (see wiki)
String nativesClassifier = nativesObj.get(currentOS).getAsString();
JsonObject nativesDownloadObj = downloadsObj.getAsJsonObject("classifiers").getAsJsonObject(nativesClassifier);
Expand Down

0 comments on commit 92a007a

Please sign in to comment.