From 058333d165204d02617c370d7804af899f2bcdcc Mon Sep 17 00:00:00 2001 From: Josh Roy <10731363+JRoy@users.noreply.github.com> Date: Fri, 2 Jun 2023 18:50:22 -0400 Subject: [PATCH] Fix regression w/empty strings with KeywordReplacer --- .../com/earth2me/essentials/textreader/KeywordReplacer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Essentials/src/main/java/com/earth2me/essentials/textreader/KeywordReplacer.java b/Essentials/src/main/java/com/earth2me/essentials/textreader/KeywordReplacer.java index 699933808ff..e658a256a27 100644 --- a/Essentials/src/main/java/com/earth2me/essentials/textreader/KeywordReplacer.java +++ b/Essentials/src/main/java/com/earth2me/essentials/textreader/KeywordReplacer.java @@ -142,7 +142,7 @@ private void replaceKeywords(final CommandSource sender) { String line = input.getLines().get(i); // Skip processing b64 encoded items, they will not have keywords in them. - if (line.charAt(0) == '@') { + if (line.startsWith("@")) { replaced.add(line); continue; } @@ -383,7 +383,7 @@ private String replaceLine(String line, final String fullMatch, final String[] m if (this.replaceSpacesWithUnderscores) { // Don't replace spaces with underscores in command nor escape underscores. - if (line.charAt(0) != '/') { + if (line.startsWith("/")) { replacer = replacer.replace("_", "\\_").replaceAll("\\s", "_"); } }