Permalink
Browse files

Fix NPE in player_interact when clicking nothing

  • Loading branch information...
PseudoKnight committed Aug 8, 2018
1 parent 6a8a233 commit 2af196cce499bf4845a06fb2f3f3a919e00326f4
Showing with 10 additions and 3 deletions.
  1. +10 −3 src/main/java/com/laytonsmith/core/events/drivers/PlayerEvents.java
@@ -947,9 +947,16 @@ public boolean matches(Map<String, Construct> prefilter, BindableEvent e) throws
}
}
if(prefilter.containsKey("block")) {
String value = prefilter.get("block").val();
if(!pie.getClickedBlock().getType().getName().equals(value)) {
return false;
Construct value = prefilter.get("block");
MCBlock b = pie.getClickedBlock();
if(value instanceof CNull) {
if(!b.isEmpty()) {
return false;
}
} else {
if(!b.getType().getName().equals(value.val())) {
return false;
}
}
}
Prefilters.match(prefilter, "player", pie.getPlayer().getName(), PrefilterType.MACRO);

0 comments on commit 2af196c

Please sign in to comment.