mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-12-18 15:17:36 +01:00
Fixed an error that occured when clearing a non-existant region's parent.
This commit is contained in:
parent
88d79a42e6
commit
2024a93126
@ -835,6 +835,9 @@ public void setParent(CommandContext args, CommandSender sender) throws CommandE
|
||||
|
||||
RegionManager mgr = plugin.getGlobalRegionManager().get(world);
|
||||
ProtectedRegion region = mgr.getRegion(id);
|
||||
if (region == null) {
|
||||
throw new CommandException("Could not find a target region by that ID.");
|
||||
}
|
||||
|
||||
if (args.argsLength() == 1) {
|
||||
try {
|
||||
@ -848,10 +851,6 @@ public void setParent(CommandContext args, CommandSender sender) throws CommandE
|
||||
String parentId = args.getString(1);
|
||||
ProtectedRegion parent = mgr.getRegion(parentId);
|
||||
|
||||
if (region == null) {
|
||||
throw new CommandException("Could not find a target region by that ID.");
|
||||
}
|
||||
|
||||
if (parent == null) {
|
||||
throw new CommandException("Could not find the parent region by that ID.");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user