From d6e75c7ea2374e34258a6e9193dd800a03f9af9b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Thu, 25 Feb 2021 19:25:04 +0200 Subject: [PATCH] Solved crash for badly defined mods like REKmod --- core/src/com/unciv/logic/map/TileInfo.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/map/TileInfo.kt b/core/src/com/unciv/logic/map/TileInfo.kt index 6805cf87e7..b0facc1373 100644 --- a/core/src/com/unciv/logic/map/TileInfo.kt +++ b/core/src/com/unciv/logic/map/TileInfo.kt @@ -230,8 +230,9 @@ open class TileInfo { val resource = getTileResource() stats.add(getTileResource()) // resource base if (resource.building != null && city != null && city.cityConstructions.isBuilt(resource.building!!)) { - val resourceBuilding = tileMap.gameInfo.ruleSet.buildings[resource.building!!]!! - stats.add(resourceBuilding.resourceBonusStats!!) // resource-specific building (eg forge, stable) bonus + val resourceBuilding = tileMap.gameInfo.ruleSet.buildings[resource.building!!] + if (resourceBuilding != null && resourceBuilding.resourceBonusStats != null) + stats.add(resourceBuilding.resourceBonusStats!!) // resource-specific building (eg forge, stable) bonus } }