Fixed NPE in vehicle damage handler.

Ugh, more stupid shit - if it's a vehicle damage event, how can there be
no vehicle associated?
This commit is contained in:
ryanhamshire 2014-12-04 20:01:21 -08:00
parent 7a0fa0d05a
commit 77a7893673

View File

@ -568,6 +568,9 @@ class EntityEventHandler implements Listener
//all of this is anti theft code //all of this is anti theft code
if(!GriefPrevention.instance.config_claims_preventTheft) return; if(!GriefPrevention.instance.config_claims_preventTheft) return;
//input validation
if(event.getVehicle() == null) return;
//don't track in worlds where claims are not enabled //don't track in worlds where claims are not enabled
if(!GriefPrevention.instance.claimsEnabledForWorld(event.getVehicle().getWorld())) return; if(!GriefPrevention.instance.claimsEnabledForWorld(event.getVehicle().getWorld())) return;