Fixed NPE when creating a shop not in a PlotSquared plot

This commit is contained in:
Eric 2017-03-30 20:44:28 +02:00
parent 71e2c48cc2
commit 08f65dbee0

View File

@ -246,7 +246,7 @@ public class Utils {
* @return Whether the flag is allowed for the player * @return Whether the flag is allowed for the player
*/ */
public static boolean isFlagAllowedOnPlot(Plot plot, Flag flag, Player p) { 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); Object o = plot.getFlag(flag, PlotSquaredShopFlag.Group.NONE);
if (o instanceof PlotSquaredShopFlag.Group) { if (o instanceof PlotSquaredShopFlag.Group) {
@ -267,7 +267,7 @@ public class Utils {
} }
} }
return false; return true;
} }
/** /**