From 7b45ff54ad62fb92a94cf8461d7d05f36a9fb2b2 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 3 Jun 2017 00:44:10 -0500 Subject: [PATCH] Prevent NPE when setting tempt target to null By: chickeneer --- paper-server/nms-patches/PathfinderGoalTempt.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/nms-patches/PathfinderGoalTempt.patch b/paper-server/nms-patches/PathfinderGoalTempt.patch index e057409407..ec9ecd2649 100644 --- a/paper-server/nms-patches/PathfinderGoalTempt.patch +++ b/paper-server/nms-patches/PathfinderGoalTempt.patch @@ -34,7 +34,7 @@ + if (event.isCancelled()) { + return false; + } -+ this.target = ((CraftLivingEntity) event.getTarget()).getHandle(); ++ this.target = (event.getTarget() == null) ? null : ((CraftLivingEntity) event.getTarget()).getHandle(); + } + return tempt; + // CraftBukkit end