aboutsummaryrefslogtreecommitdiffhomepage
path: root/Spigot-Server-Patches/0189-Avoid-NPE-in-PathfinderGoalTempt.patch
blob: 9c50e6284e76fc505e33c4a3335988945d9f6b4b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From f28a5e2b34432128d6bed2ef1671bc526da11581 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
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 fb395bcded..d1164dd682 100644
--- a/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
+++ b/src/main/java/net/minecraft/server/PathfinderGoalTempt.java
@@ -55,7 +55,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.22.0