From 1eab0feada6d09ac761c2f1e4b964cb777bf7429 Mon Sep 17 00:00:00 2001 From: Boy Date: Wed, 29 May 2024 20:28:51 +0200 Subject: [PATCH] fix: nullpointer --- .../kotlin/com/mineinabyss/chatty/listeners/ChatListener.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChatListener.kt b/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChatListener.kt index d3373b7..b2e0563 100644 --- a/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChatListener.kt +++ b/chatty-paper/src/main/kotlin/com/mineinabyss/chatty/listeners/ChatListener.kt @@ -62,7 +62,7 @@ class ChatListener : Listener { val channelData = ogChannelData.withChannelVerified() val channelId = channelData.channelId val channel = channelData.channel ?: return - val baseMessage = message().children().last() + val baseMessage = message().children().lastOrNull() ?: message() if (viewers().isNotEmpty()) viewers().clear() viewers() += channel.getAudience(player)