From 39032c3af9fa2f7a0d5f95aec0cd8c2db30c3f7b Mon Sep 17 00:00:00 2001 From: BuildTools Date: Mon, 3 Dec 2018 16:36:38 -0500 Subject: [PATCH] Catch NPE for #551 --- src/main/java/me/blackvein/quests/Quester.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/blackvein/quests/Quester.java b/src/main/java/me/blackvein/quests/Quester.java index 46ba61a6f..17e143a2e 100644 --- a/src/main/java/me/blackvein/quests/Quester.java +++ b/src/main/java/me/blackvein/quests/Quester.java @@ -739,7 +739,12 @@ public class Quester { String display = co.getDisplay(); Map datamap = getCurrentStage(quest).customObjectiveData.get(index); 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 (co.isCountShown() && co.isEnableCount()) {