From 9583b7741331492e0b1a2321731963d2c52fdfe8 Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 8 Feb 2017 14:04:05 +0100 Subject: [PATCH] Fix NPE on player join Fixes #77 --- .../de/epiceric/shopchest/listeners/ShopUpdateListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java index 592f710..84f5d88 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopUpdateListener.java @@ -28,8 +28,8 @@ public class ShopUpdateListener implements Listener { @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(PlayerJoinEvent e) { for (Shop shop : plugin.getShopUtils().getShops()) { - shop.getHologram().hidePlayer(e.getPlayer()); - shop.getItem().setVisible(e.getPlayer(), false); + if (shop.getHologram() != null) shop.getHologram().hidePlayer(e.getPlayer()); + if (shop.getItem() != null) shop.getItem().setVisible(e.getPlayer(), false); } }