From 3558105789a316bcdab07bed6dc68f17b236c162 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Wed, 17 Aug 2016 15:08:01 +1000 Subject: [PATCH] Fix default flags NPE --- .../java/com/intellectualcrafters/plot/flag/FlagManager.java | 2 +- .../main/java/com/intellectualcrafters/plot/flag/Flags.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java b/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java index 76d848749..7436e02c2 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/FlagManager.java @@ -346,7 +346,7 @@ public class FlagManager { } else { split = key.split(":"); } - Flag flag = getFlag(split[0]); + Flag flag = getOrCreateFlag(split[0]); Object value = flag.parseValue(split[1]); map.put(flag, value); } diff --git a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java index 32f66f2a7..c740bc1b8 100644 --- a/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java +++ b/Core/src/main/java/com/intellectualcrafters/plot/flag/Flags.java @@ -149,8 +149,8 @@ public final class Flags { } public static Flag getFlag(String flag) { - return flags.get(flag); -} + return flags.get(flag); + } public static void registerFlag(final Flag flag) { final Flag duplicate = flags.put(flag.getName(), flag);