mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-18 07:07:43 +01:00
Handle null custom flags registered by third-party plugins.
See WORLDGUARD-3094.
This commit is contained in:
parent
f788f0e0d9
commit
ac88367f6c
@ -89,6 +89,14 @@ public void load() throws ProtectionDatabaseException {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Warning for WORLDGUARD-3094
|
||||||
|
for (Flag<?> flag : DefaultFlag.getFlags()) {
|
||||||
|
if (flag == null) {
|
||||||
|
logger.severe("Some 3rd-party plugin has registered an invalid 'null' custom flag with WorldGuard, though we can't tell you which plugin did it - this may cause major problems in other places");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Map<String,ProtectedRegion> regions = new HashMap<String,ProtectedRegion>();
|
Map<String,ProtectedRegion> regions = new HashMap<String,ProtectedRegion>();
|
||||||
Map<ProtectedRegion,String> parentSets = new LinkedHashMap<ProtectedRegion, String>();
|
Map<ProtectedRegion,String> parentSets = new LinkedHashMap<ProtectedRegion, String>();
|
||||||
|
|
||||||
@ -174,6 +182,12 @@ private void setFlags(ProtectedRegion region, YAMLNode flagsData) {
|
|||||||
|
|
||||||
// @TODO: Make this better
|
// @TODO: Make this better
|
||||||
for (Flag<?> flag : DefaultFlag.getFlags()) {
|
for (Flag<?> flag : DefaultFlag.getFlags()) {
|
||||||
|
if (flag == null) {
|
||||||
|
// Some plugins that add custom flags to WorldGuard are doing
|
||||||
|
// something very wrong -- see WORLDGUARD-3094
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Object o = flagsData.getProperty(flag.getName());
|
Object o = flagsData.getProperty(flag.getName());
|
||||||
if (o != null) {
|
if (o != null) {
|
||||||
setFlag(region, flag, o);
|
setFlag(region, flag, o);
|
||||||
|
Loading…
Reference in New Issue
Block a user