From a009b1082453841aa0784233fc158e82aba50fed Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Wed, 10 May 2023 13:01:53 +0200 Subject: Fixed ComposterOverlay crash with invalid item selected --- .../features/garden/composter/ComposterOverlay.kt | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt index 0cd611e2d..018ffe73b 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/garden/composter/ComposterOverlay.kt @@ -142,9 +142,26 @@ class ComposterOverlay { private fun update() { if (organicMatterFactors.isEmpty()) { organicMatterDisplay = - Collections.singletonList(listOf("§cSkyHanni composter error:", "§cRepo data not loaded!")) + Collections.singletonList( + listOf( + "§cSkyHanni composter error:", "§cRepo data not loaded!", + "§7(organicMatterFactors is empty)" + ) + ) return } + if (fuelFactors.isEmpty()) { + organicMatterDisplay = + Collections.singletonList( + listOf( + "§cSkyHanni composter error:", "§cRepo data not loaded!", + "§7(fuelFactors is empty)" + ) + ) + return + } + if (currentOrganicMatterItem.let { it !in organicMatterFactors && it != "" }) currentOrganicMatterItem = "" + if (currentFuelItem.let { it !in organicMatterFactors && it != "" }) currentFuelItem = "" if (inComposter) { organicMatterDisplay = drawOrganicMatterDisplay() -- cgit