Skip to content

Commit

Permalink
[Placeholders] Add validation check to PlaceholderManagerImpl#getPlac…
Browse files Browse the repository at this point in the history
…eholder
  • Loading branch information
NEZNAMY committed Oct 26, 2024
1 parent 5273ad0 commit 6f76093
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,9 @@ public Placeholder getPlaceholderRaw(@NotNull String identifier) {
@Override
@NotNull
public synchronized TabPlaceholder getPlaceholder(@NonNull String identifier) {
if (identifier.charAt(0) != '%' || identifier.charAt(identifier.length() - 1) != '%') {
throw new IllegalArgumentException("Placeholder identifier must start and end with %");
}
TabPlaceholder p = (TabPlaceholder) registeredPlaceholders.get(identifier);
if (p == null) {
TabPlaceholderRegisterEvent event = new TabPlaceholderRegisterEvent(identifier);
Expand Down

0 comments on commit 6f76093

Please sign in to comment.