Fixed NullPointerException when clicking outside of inventory GUI.

This commit is contained in:
NewGarbo 2015-10-21 08:10:53 +01:00
parent a5df50de92
commit 112f34c77f

View File

@ -52,7 +52,7 @@ public class TravelShop extends ShopBase<ClansManager>
public void onInventoryClickedd(InventoryClickEvent event) public void onInventoryClickedd(InventoryClickEvent event)
{ {
ItemStack item = event.getCurrentItem(); ItemStack item = event.getCurrentItem();
if (item.getItemMeta() == null || item.getItemMeta().getDisplayName() == null) return; if (item == null || item.getItemMeta() == null || item.getItemMeta().getDisplayName() == null) return;
else if (isPlayerInShop(event.getWhoClicked())) return; else if (isPlayerInShop(event.getWhoClicked())) return;
String displayName = event.getCurrentItem().getItemMeta().getDisplayName(); String displayName = event.getCurrentItem().getItemMeta().getDisplayName();