Skip to content

Commit

Permalink
fix placeholder replacement npe in messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ryderbelserion committed Jul 18, 2024
1 parent 67b33f6 commit 9792749
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,14 @@ public String getMessage(@NotNull final CommandSender sender, @NotNull final Map

if (!placeholders.isEmpty()) {
for (Map.Entry<String, String> placeholder : placeholders.entrySet()) {
message = message.replace(placeholder.getKey(), placeholder.getValue()).replace(placeholder.getKey().toLowerCase(), placeholder.getValue());
if (placeholder != null) {
final String key = placeholder.getKey();
final String value = placeholder.getValue();

if (key != null && value != null) {
message = message.replace(key, value).replace(key.toLowerCase(), value);
}
}
}
}

Expand Down

0 comments on commit 9792749

Please sign in to comment.