From 08f65dbee0ab657b5f2044cc833c779132a4eb99 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 30 Mar 2017 20:44:28 +0200 Subject: [PATCH] Fixed NPE when creating a shop not in a PlotSquared plot --- src/main/java/de/epiceric/shopchest/utils/Utils.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/epiceric/shopchest/utils/Utils.java b/src/main/java/de/epiceric/shopchest/utils/Utils.java index a871857..d2e9d9b 100644 --- a/src/main/java/de/epiceric/shopchest/utils/Utils.java +++ b/src/main/java/de/epiceric/shopchest/utils/Utils.java @@ -246,7 +246,7 @@ public class Utils { * @return Whether the flag is allowed for the player */ public static boolean isFlagAllowedOnPlot(Plot plot, Flag flag, Player p) { - if (flag != null) { + if (plot != null && flag != null) { Object o = plot.getFlag(flag, PlotSquaredShopFlag.Group.NONE); if (o instanceof PlotSquaredShopFlag.Group) { @@ -267,7 +267,7 @@ public class Utils { } } - return false; + return true; } /**