Check for Citizens before loading config values

This commit is contained in:
HappyPikachu 2015-03-12 23:26:39 -04:00
parent 3ce4b4fe53
commit 9538fba9b7

View File

@ -2572,7 +2572,7 @@ public class Quests extends JavaPlugin implements ConversationAbandonedListener,
skipQuestProcess("Quest block \'" + questName + "\' is missing " + RED + "name:");
}
if (config.contains("quests." + questName + ".npc-giver-id")) {
if (citizens != null && config.contains("quests." + questName + ".npc-giver-id")) {
if (CitizensAPI.getNPCRegistry().getById(config.getInt("quests." + questName + ".npc-giver-id")) != null) {
quest.npcStart = CitizensAPI.getNPCRegistry().getById(config.getInt("quests." + questName + ".npc-giver-id"));