Fixed NullPointer in Explosion permission

This commit is contained in:
Fabrizio La Rosa 2020-06-18 04:36:25 +02:00
parent f73ac5d5ba
commit b58eef400d

View File

@ -81,7 +81,7 @@ public class ExplosionsPermission extends ListeningPermission {
@PermissionHandler
public void onTNTInteract(PlayerInteractEvent event) {
if(event.getItem().getType().equals(CompatibleMaterial.FLINT_AND_STEEL.getMaterial())
if(event.getItem() != null && event.getItem().getType().equals(CompatibleMaterial.FLINT_AND_STEEL.getMaterial())
&& event.getClickedBlock().getType().equals(CompatibleMaterial.TNT.getBlockMaterial())){
cancelAndMessage(event, event.getPlayer(), plugin, plugin.getMessageManager());
}