From 7a2ec54945010259981b63ba372bbb84e217fa7e Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Mon, 31 Aug 2020 22:37:49 +0200 Subject: [PATCH] Ignore invalid requirements --- .../java/de/erethon/dungeonsxl/player/DGlobalPlayer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/player/DGlobalPlayer.java b/core/src/main/java/de/erethon/dungeonsxl/player/DGlobalPlayer.java index 4ccde7b4..e72e509f 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/player/DGlobalPlayer.java +++ b/core/src/main/java/de/erethon/dungeonsxl/player/DGlobalPlayer.java @@ -18,7 +18,6 @@ package de.erethon.dungeonsxl.player; import de.erethon.commons.chat.MessageUtil; import de.erethon.commons.compatibility.Internals; -import de.erethon.commons.player.PlayerUtil; import de.erethon.dungeonsxl.DungeonsXL; import de.erethon.dungeonsxl.api.Requirement; import de.erethon.dungeonsxl.api.Reward; @@ -284,6 +283,10 @@ public class DGlobalPlayer implements GlobalPlayer { boolean genericReqs = true; List msgs = new ArrayList<>(rules.getState(GameRule.REQUIREMENTS).size()); for (Requirement requirement : rules.getState(GameRule.REQUIREMENTS)) { + if (requirement == null) { + MessageUtil.log(plugin, "The dungeon " + dungeon.getName() + " has an invalid requirement."); + continue; + } RequirementCheckEvent event = new RequirementCheckEvent(requirement, dungeon, player, rules.getState(GameRule.KEEP_INVENTORY_ON_ENTER)); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) {