From 34b6ac6b6f956c04ba565b109aa826880eef0661 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sat, 2 Sep 2023 09:40:53 +0200 Subject: Hopefully fixed a rare chat error --- src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2') diff --git a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt index 4954d2caf..c7ddf1777 100644 --- a/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt +++ b/src/main/java/at/hannibal2/skyhanni/data/ChatManager.kt @@ -156,8 +156,8 @@ object ChatManager { val chatGUI = Minecraft.getMinecraft().ingameGUI.chatGUI @Suppress("UNCHECKED_CAST") - val chatLines = chatLinesField.invokeExact(chatGUI) as MutableList - if (!chatLines.removeIf { it.chatComponent === message }) return + val chatLines = chatLinesField.invokeExact(chatGUI) as MutableList? ?: return + if (!chatLines.removeIf { it?.chatComponent === message }) return chatGUI.refreshChat() val history = messageHistory[IdentityCharacteristics(message)] ?: return -- cgit