From dd985ab2c505593acb8c1c31c8d8bb8d3c58e308 Mon Sep 17 00:00:00 2001 From: PikaMug Date: Tue, 27 Aug 2019 12:53:55 -0400 Subject: [PATCH] Potential fix for #924 --- main/src/main/java/me/blackvein/quests/Quester.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main/src/main/java/me/blackvein/quests/Quester.java b/main/src/main/java/me/blackvein/quests/Quester.java index a7f82c6ff..57e995c6d 100644 --- a/main/src/main/java/me/blackvein/quests/Quester.java +++ b/main/src/main/java/me/blackvein/quests/Quester.java @@ -1693,6 +1693,9 @@ public class Quester { int index = 0; for (Location location : getQuestData(quest).locationsReached) { try { + if (getCurrentStage(quest).locationsToReach.size() <= index) { + return; + } Location locationToReach = getCurrentStage(quest).locationsToReach.get(index); double radius = getQuestData(quest).radiiToReachWithin.get(index); if (l.getX() < (locationToReach.getX() + radius) && l.getX() > (locationToReach.getX() - radius)) { @@ -1711,6 +1714,7 @@ public class Quester { } } index++; + } catch (IndexOutOfBoundsException e) { plugin.getLogger().severe("An error has occurred with Quests. Please report on Github. Include the info below"); plugin.getLogger().warning("index = " + index);