mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-24 18:01:26 +02:00
Fixed possible NPE when a projectile doesn't have a shooter
This commit is contained in:
@ -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();
|
||||
|
Reference in New Issue
Block a user