Skip to content

Commit

Permalink
Handle out of bound lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
me4502 committed Apr 26, 2017
1 parent 14c2a86 commit 5a460b4
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5a460b4

Please sign in to comment.