Fixed possible NPE when a projectile doesn't have a shooter

This commit is contained in:
bm01 2012-06-05 15:39:04 +02:00
parent 1cca4de9e5
commit a1296596fa

View File

@ -64,6 +64,11 @@ public class EntityListener implements Listener {
if (attacker instanceof Projectile) {
attacker = ((Projectile) attacker).getShooter();
//There is no shooter when a projectile is thrown by a dispenser
if (attacker == null) {
return;
}
}
else if (attacker instanceof Tameable) {
AnimalTamer animalTamer = ((Tameable) attacker).getOwner();