From 4933082088e1e63d7a88d49e73db45be01a01827 Mon Sep 17 00:00:00 2001 From: Skekdog <47750815+Skekdog@users.noreply.github.com> Date: Sat, 18 Jun 2022 00:54:26 +0100 Subject: [PATCH] Fix crash when base ruleset contains no strategic resources (#7193) --- core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt index 58cd450849..341792db39 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreenTopBar.kt @@ -158,9 +158,13 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() { } // in case the icons are configured higher than a label, we add a dummy - height will be measured once before it's updated - resourcesWrapper.add(resourceActors[0].icon) + if (resourceActors.isNotEmpty()) { + resourcesWrapper.add(resourceActors[0].icon) + resourceTable.add(resourcesWrapper) + } + resourceTable.add(turnsLabel).pad(5f, 5f, 10f, 5f) - resourceTable.add(resourcesWrapper) + return resourceTable }