Prevent error from short command display override list, fixes #892

This commit is contained in:
PikaMug 2019-08-18 15:53:27 -04:00
parent fcda4d45e9
commit 0af81d81d1
2 changed files with 6 additions and 3 deletions

View File

@ -624,9 +624,11 @@ public class Quest {
int index = 0;
for (String s : rews.getCommands()) {
if (rews.getCommandsOverrideDisplay().isEmpty() == false && rews.getCommandsOverrideDisplay().size() >= index) {
if (rews.getCommandsOverrideDisplay().size() > index) {
if (!rews.getCommandsOverrideDisplay().get(index).trim().equals("")) {
player.sendMessage("- " + ChatColor.DARK_GREEN + rews.getCommandsOverrideDisplay().get(index));
}
}
} else {
player.sendMessage("- " + ChatColor.DARK_GREEN + s);
}

View File

@ -1714,7 +1714,8 @@ public class Quester {
} 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);
plugin.getLogger().warning("locationsReached = " + getQuestData(quest).locationsReached.toString());
plugin.getLogger().warning("currentLocation = " + location.toString());
plugin.getLogger().warning("locationsReached = " + getQuestData(quest).locationsReached.size());
plugin.getLogger().warning("hasReached = " + getQuestData(quest).hasReached.size());
e.printStackTrace();
}