mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-19 15:48:10 +01:00
Fix occasional NPE when players quit timed quests, fixes #559
This commit is contained in:
parent
c77becce48
commit
99d4598c16
@ -701,9 +701,11 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
for (Integer timerId : quester.timers.keySet()) {
|
for (Integer timerId : quester.timers.keySet()) {
|
||||||
plugin.getServer().getScheduler().cancelTask(timerId);
|
plugin.getServer().getScheduler().cancelTask(timerId);
|
||||||
|
if (quester.timers.containsKey(timerId)) {
|
||||||
quester.timers.get(timerId).failQuest(quester);
|
quester.timers.get(timerId).failQuest(quester);
|
||||||
quester.timers.remove(timerId);
|
quester.timers.remove(timerId);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (quester.hasData()) {
|
if (quester.hasData()) {
|
||||||
quester.saveData();
|
quester.saveData();
|
||||||
|
Loading…
Reference in New Issue
Block a user