Permalink
Browse files

Handle out of bound lines.

  • Loading branch information...
me4502 committed Apr 26, 2017
1 parent 14c2a86 commit 5a460b46efa0647b2861fee201768ec192fd8e99
Showing with 4 additions and 0 deletions.
  1. +4 −0 src/main/java/com/sk89q/craftbook/mechanics/signcopier/SignEditCommands.java
@@ -33,6 +33,10 @@ public void editSign(CommandContext context, CommandSender sender) throws Comman
int line = context.getInteger(0, 0);
String text = context.getString(1, "");
+ if (line < 1 || line > 4) {
+ throw new FastCommandException("Line out of bounds. Must be between 1 and 4.");
+ }
+
String[] signCache = SignCopier.signs.get(sender.getName());
signCache[line - 1] = text;
SignCopier.signs.put(sender.getName(), signCache);

0 comments on commit 5a460b4

Please sign in to comment.