Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-11-10 05:20:04 +01:00
Fixed SIOOBE when entering a blank quoted string
Dieser Commit ist enthalten in:
Ursprung
9aa8c5f674
Commit
a1e239d08c
@ -64,7 +64,7 @@ public class CommandContext {
|
|||||||
List<String> argList = new ArrayList<String>(args.length);
|
List<String> argList = new ArrayList<String>(args.length);
|
||||||
for (int i = 1; i < args.length; ++i) {
|
for (int i = 1; i < args.length; ++i) {
|
||||||
String arg = args[i];
|
String arg = args[i];
|
||||||
if (arg.isEmpty()) {
|
if (arg.length() == 0) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -94,6 +94,11 @@ public class CommandContext {
|
|||||||
arg = build.toString();
|
arg = build.toString();
|
||||||
i = endIndex;
|
i = endIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// In case there is an empty quoted string
|
||||||
|
if (arg.length() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// else raise exception about hanging quotes?
|
// else raise exception about hanging quotes?
|
||||||
}
|
}
|
||||||
argList.add(arg);
|
argList.add(arg);
|
||||||
|
@ -241,8 +241,8 @@ public class PermissionsResolverManager implements PermissionsResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (keys.contains("dinner-perms") || keys.contains("dinnerperms")) {
|
if (keys.contains("dinner-perms") || keys.contains("dinnerperms")) {
|
||||||
config.setProperty("dinner-perms", null);
|
config.removeProperty("dinner-perms");
|
||||||
config.setProperty("dinnerperms", null);
|
config.removeProperty("dinnerperms");
|
||||||
isUpdated = true;
|
isUpdated = true;
|
||||||
}
|
}
|
||||||
if (!keys.contains("permissions")) {
|
if (!keys.contains("permissions")) {
|
||||||
|
@ -143,4 +143,15 @@ public class CommandContextTest {
|
|||||||
fail("Error creating CommandContext");
|
fail("Error creating CommandContext");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testEmptyQuote() {
|
||||||
|
try {
|
||||||
|
CommandContext context = new CommandContext("region flag xmas blocked-cmds \"\"");
|
||||||
|
assertEquals(context.argsLength(), 3);
|
||||||
|
} catch (CommandException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
fail("Error creating CommandContext");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren