aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2024-10-09 13:14:56 +0200
committerGitHub <noreply@github.com>2024-10-09 13:14:56 +0200
commit4c7409ca07be69d2708f22db6bba229a18557ce7 (patch)
tree2528a6fd84c14cdfba3fa6a90be93a6bf512d880 /src
parent2ebce56d4fa44fb12ec15a436feea6c43f7ecd8b (diff)
downloadskyhanni-4c7409ca07be69d2708f22db6bba229a18557ce7.tar.gz
skyhanni-4c7409ca07be69d2708f22db6bba229a18557ce7.tar.bz2
skyhanni-4c7409ca07be69d2708f22db6bba229a18557ce7.zip
Fix: empty list in compact experiment rewards (#2702)
Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/chat/CompactExperimentRewards.kt4
1 files changed, 2 insertions, 2 deletions
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<String>()
+ private val gainedRewards = mutableListOf<String>()
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<String>().apply {
gainedRewards.forEach { add("ยง8+$it") }