Catch error in #155

This commit is contained in:
HappyPikachu 2017-12-20 22:00:49 -05:00
parent aca1bb211c
commit d3156c6d0f
2 changed files with 12 additions and 5 deletions

View File

@ -78,7 +78,6 @@ public class NpcListener implements Listener {
break; break;
} }
} }
// break;
} }
} }
} }

View File

@ -887,12 +887,20 @@ public class Quester {
} }
public void interactWithNPC(Quest quest, NPC n) { public void interactWithNPC(Quest quest, NPC n) {
try {
if (getQuestData(quest).citizensInteracted.containsKey(n.getId())) { if (getQuestData(quest).citizensInteracted.containsKey(n.getId())) {
if (getQuestData(quest).citizensInteracted.get(n.getId()) == false) { if (getQuestData(quest).citizensInteracted.get(n.getId()) == false) {
getQuestData(quest).citizensInteracted.put(n.getId(), true); getQuestData(quest).citizensInteracted.put(n.getId(), true);
finishObjective(quest, "talkToNPC", null, null, null, null, null, n, null, null, null, null); finishObjective(quest, "talkToNPC", null, null, null, null, null, n, null, null, null, null);
} }
} }
} catch (NullPointerException e) {
//Github ticket #155
plugin.getLogger().severe("An error has occurred with Quests. Please report on Github. Include the info below");
plugin.getLogger().severe("npc + id = " + n.getName() + " + " + n.getId());
plugin.getLogger().severe("citizensInteracted = " + getQuestData(quest).citizensInteracted.toString());
e.printStackTrace();
}
} }
public void killNPC(Quest quest, NPC n) { public void killNPC(Quest quest, NPC n) {