diff options
Diffstat (limited to 'src/main')
3 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt index db1375b75..9a18572b1 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/inventory/ShiftClickNPCSell.kt @@ -29,7 +29,7 @@ object ShiftClickNPCSell { @SubscribeEvent fun onOpen(event: InventoryFullyOpenedEvent) { if (!LorenzUtils.inSkyBlock) return - inInventory = lastLoreLineOfSellPattern.matches(event.inventoryItems[sellSlot]?.getLore()?.lastOrNull() ?: "") + inInventory = lastLoreLineOfSellPattern.matches(event.inventoryItems[sellSlot]?.getLore()?.lastOrNull()) } @SubscribeEvent diff --git a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt index 9aee4035d..f5552701e 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/minion/MinionFeatures.kt @@ -133,7 +133,7 @@ class MinionFeatures { if (!minionTitlePattern.find(event.inventoryName)) return event.inventoryItems[48]?.let { - if (minionCollectItemPattern.matches(it.name ?: "")) { + if (minionCollectItemPattern.matches(it.name)) { MinionOpenEvent(event.inventoryName, event.inventoryItems).postAndCatch() return } diff --git a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt index 7c33cd1b2..b25c47aae 100644 --- a/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt +++ b/src/main/java/at/hannibal2/skyhanni/utils/StringUtils.kt @@ -281,9 +281,9 @@ object StringUtils { fun String.convertToFormatted(): String = this.replace("&&", "ยง") - fun Pattern.matches(string: String) = matcher(string).matches() + fun Pattern.matches(string: String?) = string?.let { matcher(it).matches() } ?: false - fun Pattern.find(string: String) = matcher(string).find() + fun Pattern.find(string: String?) = string?.let { matcher(it).find() } ?: false fun String.allLettersFirstUppercase() = split("_").joinToString(" ") { it.firstLetterUppercase() } |