Fix error, that meta can be null

This commit is contained in:
Timo Ley 2020-07-24 22:17:35 +02:00
parent f05d4e33c3
commit 8da44daa99
2 changed files with 6 additions and 2 deletions

View File

@ -44,6 +44,8 @@ public class CurseforgeRepository implements IRepository {
} catch (CurseException e) {
e.printStackTrace();
}
} else {
System.out.println("WARNUNG: No file for Curseforge artifact " + artifact + " found!");
}
return meta;
}

View File

@ -377,7 +377,9 @@ public class AddonscriptJSON extends ASBase {
}
}
}
return null;
Meta meta = new Meta();
meta.name = link;
return meta;
}
}
@ -385,7 +387,7 @@ public class AddonscriptJSON extends ASBase {
public static class Relation {
public Meta getMeta(Indexes indexes) {
if(indexes.ADDONS.values().contains(id))
if(indexes.ADDONS.values().contains(id) && indexes.ADDONS.get(id).meta != null)
return indexes.ADDONS.get(id).meta;
else if(meta != null)
return meta;