Prevent NPE when setting tempt target to null

This commit is contained in:
chickeneer 2017-06-03 00:44:10 -05:00 committed by md_5
parent 10daedccdd
commit fe3ca95c76

View file

@ -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