Skip to content

Commit

Permalink
[JENKINS-35544] Fix NPE when module has no version.
Browse files Browse the repository at this point in the history
  • Loading branch information
fengtan committed Aug 2, 2016
1 parent 0be1fc4 commit 7e538e8
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -36,6 +36,7 @@
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Objects;

import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections.MapUtils;
Expand Down Expand Up @@ -219,7 +220,12 @@ public Map<String, DrupalExtension> getProjects(boolean modulesOnly, boolean ena
}
for (Object name: entries.keySet()) {
JSONObject entry = (JSONObject) entries.get(name);
DrupalExtension project = new DrupalExtension(name.toString(), entry.get("type").toString(), entry.get("status").toString(), entry.get("version").toString());
DrupalExtension project = new DrupalExtension(
Objects.toString(name, ""),
Objects.toString(entry.get("type"), ""),
Objects.toString(entry.get("status"), ""),
Objects.toString(entry.get("version"), "")
);
projects.put(name.toString(), project);
}

Expand Down

0 comments on commit 7e538e8

Please sign in to comment.