diff --git a/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java b/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java index f0136a9..4520ccc 100644 --- a/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java +++ b/src/main/java/de/epiceric/shopchest/listeners/ShopItemListener.java @@ -83,10 +83,12 @@ public class ShopItemListener implements Listener { for (Shop shop : shopUtils.getShops()) { Location shopLocation = shop.getLocation(); if (w.equals(shopLocation.getWorld()) && shopLocation.distanceSquared(playerLocation) <= itemDistanceSquared) { - if (reset) shop.getItem().resetForPlayer(p); - else shop.getItem().setVisible(p, true); + if (shop.getItem() != null) { + if (reset) shop.getItem().resetForPlayer(p); + else shop.getItem().setVisible(p, true); + } } else if (hideIfAway) { - shop.getItem().setVisible(p, false); + if (shop.getItem() != null) shop.getItem().setVisible(p, false); } } }