From 11a57af68adc71c467b1de21f02ab0ec2c7158d6 Mon Sep 17 00:00:00 2001 From: Warrior <50800980+Warriorrrr@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:21:47 +0100 Subject: [PATCH] Fix an NPE in the isOutlawInTown method --- .../java/com/palmergames/bukkit/towny/utils/CombatUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Towny/src/main/java/com/palmergames/bukkit/towny/utils/CombatUtil.java b/Towny/src/main/java/com/palmergames/bukkit/towny/utils/CombatUtil.java index f9f942cc12..988ebc8445 100644 --- a/Towny/src/main/java/com/palmergames/bukkit/towny/utils/CombatUtil.java +++ b/Towny/src/main/java/com/palmergames/bukkit/towny/utils/CombatUtil.java @@ -437,6 +437,9 @@ public static boolean isArenaPlot(TownBlock attackerTB, TownBlock defenderTB) { * @return true if one of the players is an outlaw in a situation where that matters. */ private static boolean isOutlawInTown(TownBlock defenderTB, Player attackingPlayer, Player defendingPlayer) { + if (defenderTB == null) + return false; + Town town = defenderTB.getTownOrNull(); if (town == null) return false;