diff --git a/src/com/sk89q/worldguard/protection/databases/CSVDatabase.java b/src/com/sk89q/worldguard/protection/databases/CSVDatabase.java index 20dc2082..3f3e5bbb 100644 --- a/src/com/sk89q/worldguard/protection/databases/CSVDatabase.java +++ b/src/com/sk89q/worldguard/protection/databases/CSVDatabase.java @@ -262,7 +262,11 @@ private void parseFlags(ProtectedRegion region, String data) { } StateFlag flag = DefaultFlag.getLegacyFlag(flagStr); - region.setFlag(flag, curState); + if (flag != null) { + region.setFlag(flag, curState); + } else { + logger.warning("Legacy flag '" + flagStr + "' is unsupported"); + } } } } diff --git a/src/com/sk89q/worldguard/protection/flags/DefaultFlag.java b/src/com/sk89q/worldguard/protection/flags/DefaultFlag.java index 1ef9257f..4679d594 100644 --- a/src/com/sk89q/worldguard/protection/flags/DefaultFlag.java +++ b/src/com/sk89q/worldguard/protection/flags/DefaultFlag.java @@ -74,7 +74,7 @@ public static Flag[] getFlags() { */ public static StateFlag getLegacyFlag(String flagString) { for (Flag flag : flagsList) { - if (flag instanceof StateFlag && flagString.equals(flag.getLegacyCode())) { + if (flag instanceof StateFlag && flagString.equals(String.valueOf(flag.getLegacyCode()))) { return (StateFlag) flag; } }