Skip to content

Commit

Permalink
Merge pull request #39 from FactorioBlueprints/mod-dependencies
Browse files Browse the repository at this point in the history
Fix handling mods with a missing array of dependencies.
  • Loading branch information
Bilka2 authored Dec 31, 2022
2 parents 5f0587e + 716b987 commit 6c8e040
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion FactorioDataWrapper/src/com/demod/factorio/ModInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public ModInfo(JSONObject json) {
contact = json.optString("contact", "");
homepage = json.optString("homepage", "");
description = json.optString("description", "");
JSONArray dependenciesJson = json.getJSONArray("dependencies");
JSONArray dependenciesJson = json.optJSONArray("dependencies");
if (dependenciesJson == null)
{
dependenciesJson = new JSONArray();
}
for (int i = 0; i < dependenciesJson.length(); i++) {
String depString = dependenciesJson.getString(i);
String[] depSplit = depString.split("\\s");
Expand Down

0 comments on commit 6c8e040

Please sign in to comment.