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,11 +887,19 @@ public class Quester {
} }
public void interactWithNPC(Quest quest, NPC n) { public void interactWithNPC(Quest quest, NPC n) {
if (getQuestData(quest).citizensInteracted.containsKey(n.getId())) { try {
if (getQuestData(quest).citizensInteracted.get(n.getId()) == false) { if (getQuestData(quest).citizensInteracted.containsKey(n.getId())) {
getQuestData(quest).citizensInteracted.put(n.getId(), true); if (getQuestData(quest).citizensInteracted.get(n.getId()) == false) {
finishObjective(quest, "talkToNPC", null, null, null, null, null, n, null, null, null, null); getQuestData(quest).citizensInteracted.put(n.getId(), true);
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();
} }
} }