Avoid error on player quit, fixes #649

This commit is contained in:
BuildTools 2019-01-22 16:45:22 -05:00
parent a92ff51231
commit 39294f18f3

View File

@ -748,9 +748,10 @@ public class PlayerListener implements Listener {
plugin.getQuestFactory().setSelectingNpcs(temp); plugin.getQuestFactory().setSelectingNpcs(temp);
} }
LinkedList<Quester> temp = plugin.getQuesters(); LinkedList<Quester> temp = plugin.getQuesters();
for (Quester q : temp) { for (Iterator<Quester> iterator = temp.iterator(); iterator.hasNext();) {
Quester q = iterator.next();
if (q.getUUID().equals(quester.getUUID())) { if (q.getUUID().equals(quester.getUUID())) {
temp.remove(q); iterator.remove();
} }
} }
plugin.setQuesters(temp); plugin.setQuesters(temp);