From 825dc7cda2d4b1b6d500a075151cb37432d32566 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 28 Mar 2023 18:30:05 +0200 Subject: Fixed crash in visitor list item preview when the repo data is incomplete --- .../at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt index ecb3c541d..6483f44cc 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/GardenVisitorFeatures.kt @@ -144,7 +144,12 @@ class GardenVisitorFeatures { list.add(" §7- $displayName") if (config.visitorItemPreview) { - val items = GardenVisitorColorNames.visitorItems[visitor.removeColor()]!! + val items = GardenVisitorColorNames.visitorItems[visitor.removeColor()] + if (items == null) { + LorenzUtils.debug("Visitor '$visitor' has no items in repo!") + list.add(" §7(§c?§7)") + continue + } list.add(" ") if (items.isEmpty()) { list.add("§7(§fAny§7)") -- cgit