Catch NPE for #551

This commit is contained in:
BuildTools 2018-12-03 16:36:38 -05:00
parent c464916e9d
commit 39032c3af9

View File

@ -739,7 +739,12 @@ public class Quester {
String display = co.getDisplay(); String display = co.getDisplay();
Map<String, Object> datamap = getCurrentStage(quest).customObjectiveData.get(index); Map<String, Object> datamap = getCurrentStage(quest).customObjectiveData.get(index);
for (String key : co.datamap.keySet()) { for (String key : co.datamap.keySet()) {
display = display.replace("%" + ((String) key) + "%", ((String) datamap.get(key))); try {
display = display.replace("%" + key + "%", ((String) datamap.get(key)));
} catch (NullPointerException ne) {
plugin.getLogger().severe("Unable to fetch display for " + co.getName() + " on " + quest.name);
ne.printStackTrace();
}
} }
if (entry.getValue() < getCurrentStage(quest).customObjectiveCounts.get(index)) { if (entry.getValue() < getCurrentStage(quest).customObjectiveCounts.get(index)) {
if (co.isCountShown() && co.isEnableCount()) { if (co.isCountShown() && co.isEnableCount()) {