summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authort00thpick1 <t00thpick1dirko@gmail.com>2014-01-07 00:25:11 -0500
committerfeildmaster <admin@feildmaster.com>2014-01-18 15:52:54 -0600
commit771c41c691fe71af78039b747f565a2c8320b6a9 (patch)
tree829e418b77f7ec01e42b230e48348cdccc98160a
parentfef9f9692f5f5e494910e81af7ffd677c3e3e0f9 (diff)
downloadcraftbukkit-771c41c691fe71af78039b747f565a2c8320b6a9.tar
craftbukkit-771c41c691fe71af78039b747f565a2c8320b6a9.tar.gz
craftbukkit-771c41c691fe71af78039b747f565a2c8320b6a9.tar.lz
craftbukkit-771c41c691fe71af78039b747f565a2c8320b6a9.tar.xz
craftbukkit-771c41c691fe71af78039b747f565a2c8320b6a9.zip
[Bleeding] Account for null in EntityDamageEvent handling. Fixes BUKKIT-5317
Damage caused by explosions will return null for the event as of 6588d6f72bbca74bf150de65593ac575b846111b. As such, a null check is now necessary when handling non-living entity damage events.
-rw-r--r--src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
index 72121547..a91ffb17 100644
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
@@ -455,8 +455,10 @@ public class CraftEventFactory {
if (!(source instanceof EntityDamageSource)) {
return false;
}
- // We don't need to check for null, since EntityDamageSource will always return an event
EntityDamageEvent event = handleEntityDamageEvent(entity, source, damage);
+ if (event == null) {
+ return false;
+ }
return event.isCancelled() || event.getDamage() == 0;
}