From 60a2c568a08061f3f51ecfc5392b45a884ae37b1 Mon Sep 17 00:00:00 2001 From: ChomeNS <95471003+ChomeNS@users.noreply.github.com> Date: Sat, 21 Jun 2025 16:38:02 +0700 Subject: [PATCH] =?UTF-8?q?fix:=20stack=20overflow=20in=20component=20pars?= =?UTF-8?q?er=20when=20text=20content=20ends=20with=20`=C2=A7`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-number.txt | 2 +- .../java/me/chayapak1/chomens_bot/util/ComponentUtilities.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/build-number.txt b/build-number.txt index eae7cce1..29940999 100644 --- a/build-number.txt +++ b/build-number.txt @@ -1 +1 @@ -3468 \ No newline at end of file +3471 \ No newline at end of file diff --git a/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java b/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java index a66f431f..60cfdb6a 100644 --- a/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java +++ b/src/main/java/me/chayapak1/chomens_bot/util/ComponentUtilities.java @@ -191,6 +191,8 @@ public class ComponentUtilities { // adventure will just use the reset character, which makes the text white, // and that's not what we want .replace("§r", formatting) + // prevents stack overflow when the content ends with § + .replaceFirst("§+$", "") ); // goofy code