Fixes #3902 - NPE in Inventory Listener

This commit is contained in:
nossr50 2019-04-25 18:49:18 -07:00
parent 30df57fa35
commit be8a2a4b07
2 changed files with 5 additions and 2 deletions

View File

@ -1,6 +1,7 @@
Version 2.1.49 Version 2.1.49
Fixed a bug where falling blocks were not marked as unnatural in water Fixed a bug where falling blocks were not marked as unnatural in water
Fixed a bug where Ability cooldowns were being called async when they are sync only Fixed a bug where Ability cooldowns were being called async when they are sync only
Fixed NPE when checking inventory location
Version 2.1.48 Version 2.1.48
1.14 Support 1.14 Support

View File

@ -397,8 +397,10 @@ public class InventoryListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true) @EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) { public void onInventoryMoveItemEvent(InventoryMoveItemEvent event) {
/* WORLD BLACKLIST CHECK */ /* WORLD BLACKLIST CHECK */
if(WorldBlacklist.isWorldBlacklisted(event.getSource().getLocation().getWorld()))
return; if(event.getSource().getLocation() != null)
if(WorldBlacklist.isWorldBlacklisted(event.getSource().getLocation().getWorld()))
return;
Inventory inventory = event.getDestination(); Inventory inventory = event.getDestination();