From 92f71a39fcf82fe9231d3bafbc550c76a63109a7 Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Wed, 27 Sep 2023 13:20:32 +0200 Subject: Fix museum overlay crash and bestiary page not refreshing on profile switch (#822) --- .../miscfeatures/inventory/MuseumCheapestItemOverlay.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/kotlin') diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt index 8a711230..e968a4c7 100644 --- a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/inventory/MuseumCheapestItemOverlay.kt @@ -412,7 +412,10 @@ object MuseumCheapestItemOverlay { tooltip.add("") } - if (NotEnoughUpdates.INSTANCE.manager.getRecipesFor(line.internalNames[0]).isNotEmpty()) { + if (line.internalNames.isEmpty()) { + tooltip.add("${EnumChatFormatting.RED}Could not determine item!") + } + else if (NotEnoughUpdates.INSTANCE.manager.getRecipesFor(line.internalNames[0]).isNotEmpty()) { tooltip.add("${EnumChatFormatting.YELLOW}${EnumChatFormatting.BOLD}Click to open recipe!") } else { tooltip.add("${EnumChatFormatting.RED}${EnumChatFormatting.BOLD}No recipe available!") -- cgit