Skip to content

Commit

Permalink
Catch possible IndexOutOfRange/NPE with invalid use of flag tag.
Browse files Browse the repository at this point in the history
  • Loading branch information
aufdemrand committed Apr 2, 2013
1 parent 3608982 commit d58fc7f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/net/aufdemrand/denizen/tags/core/FlagTags.java
Expand Up @@ -33,6 +33,8 @@ private enum ReplaceType { LENGTH, SIZE, ASSTRING, ASINT, ASDOUBLE, ASLIST, ASMO
public void flagTag(ReplaceableTagEvent event) {
if (!event.matches("FLAG")) return;

if (!event.hasValue()) return;

// Replace <FLAG...> TAGs.
String flagName = event.getValue().split(":").length > 1
? event.getValue().split(":")[0].toUpperCase() : event.getValue().toUpperCase();
Expand Down

0 comments on commit d58fc7f

Please sign in to comment.