From 4c7409ca07be69d2708f22db6bba229a18557ce7 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 9 Oct 2024 13:14:56 +0200 Subject: Fix: empty list in compact experiment rewards (#2702) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../at/hannibal2/skyhanni/features/chat/CompactExperimentRewards.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactExperimentRewards.kt b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactExperimentRewards.kt index 286166ee7..8ad277b4a 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/chat/CompactExperimentRewards.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/chat/CompactExperimentRewards.kt @@ -21,7 +21,7 @@ object CompactExperimentRewards { private val config get() = SkyHanniMod.feature.chat - private var gainedRewards = mutableListOf() + private val gainedRewards = mutableListOf() private var lastTimeTableOpened = SimpleTimeMark.farPast() private var currentMessage = "" @@ -89,7 +89,7 @@ object CompactExperimentRewards { } private fun sendMessage(reward: String?) { - if (gainedRewards.last() != reward || currentMessage == "") return + if (gainedRewards.lastOrNull() != reward || currentMessage == "") return val expList = mutableListOf().apply { gainedRewards.forEach { add("ยง8+$it") } -- cgit