Show readable console error for null stage, fixes #665

This commit is contained in:
BuildTools 2019-01-30 23:50:40 -05:00
parent c8efb7d31c
commit 8c303d6b8b

View File

@ -2013,6 +2013,10 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener
private void loadCustomSections(Quest quest, FileConfiguration config, String questKey) throws StageFailedException, SkipQuest {
ConfigurationSection questStages = config.getConfigurationSection("quests." + questKey + ".stages.ordered");
for (String s2 : questStages.getKeys(false)) {
if (quest.getStage(Integer.valueOf(s2) - 1) == null) {
getLogger().severe("Unable to load custom objectives because stage" + (Integer.valueOf(s2) - 1) + " for " + quest.getName() + " was null");
return;
}
Stage oStage = quest.getStage(Integer.valueOf(s2) - 1);
oStage.customObjectives=new LinkedList<>();
oStage.customObjectiveCounts=new LinkedList<>();