From b02a8b65dfbfbeddd5c360185139f7924ce950b0 Mon Sep 17 00:00:00 2001 From: Aikar Date: Wed, 29 Nov 2017 22:19:24 -0500 Subject: [PATCH] Avoid NPE in PathfinderGoalTempt --- ...257-Avoid-NPE-in-PathfinderGoalTempt.patch | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Spigot-Server-Patches/0257-Avoid-NPE-in-PathfinderGoalTempt.patch diff --git a/Spigot-Server-Patches/0257-Avoid-NPE-in-PathfinderGoalTempt.patch b/Spigot-Server-Patches/0257-Avoid-NPE-in-PathfinderGoalTempt.patch new file mode 100644 index 0000000000..f9e86e9194 --- /dev/null +++ b/Spigot-Server-Patches/0257-Avoid-NPE-in-PathfinderGoalTempt.patch @@ -0,0 +1,22 @@ +From ce308088af5d39170b19f7781e3b4c952e015b4b Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Wed, 29 Nov 2017 22:18:54 -0500 +Subject: [PATCH] Avoid NPE in PathfinderGoalTempt + + +diff --git a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +index 188825d19..8004f3a3f 100644 +--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java ++++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java +@@ -54,7 +54,7 @@ public class PathfinderGoalTempt extends PathfinderGoal { + } + this.target = (event.getTarget() == null) ? null : ((CraftLivingEntity) event.getTarget()).getHandle(); + } +- return tempt; ++ return tempt && this.target != null; // Paper - must have target - plugin might of cancelled + // CraftBukkit end + } + } +-- +2.15.0 +