mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-01 15:03:26 +01:00
account for empty strings
This commit is contained in:
parent
b73d00e169
commit
2d72e274e3
@ -168,6 +168,9 @@ public final class CharsReplacer implements Replacer {
|
|||||||
builder.append(ChatColor.translateAlternateColorCodes('&', replacement));
|
builder.append(ChatColor.translateAlternateColorCodes('&', replacement));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (builder.length() == 0) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
char c = builder.charAt(builder.length() - 1);
|
char c = builder.charAt(builder.length() - 1);
|
||||||
if (c == ' ') {
|
if (c == ' ') {
|
||||||
return builder.substring(0, builder.length() - 1);
|
return builder.substring(0, builder.length() - 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user