From 1576f32ac6dc71f4b0578eb96682c3eb74f86cde Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 23 Aug 2023 12:33:40 +0200 Subject: Fixed error message when clicking a finished upgrade in the community shop. --- .../at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni') diff --git a/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt b/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt index 5ededb3ee..3690d8ea3 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/fame/AccountUpgradeReminder.kt @@ -72,9 +72,10 @@ class AccountUpgradeReminder { if (!inInventory) return val clickedItemLore = event.slot?.stack?.getLore() ?: return if (clickedItemLore.getOrNull(0) != "ยง8Account Upgrade") return - duration = clickedItemLore.firstNotNullOf { + val result = clickedItemLore.firstNotNullOfOrNull { durationRegex.matchEntire(it) - }.groups[1]!!.value.toInt().days + } ?: return + duration = result.groups[1]!!.value.toInt().days } @SubscribeEvent -- cgit