From 5b73fcd419ed59366a6adb08c05e32ae1098f1f5 Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Wed, 24 Apr 2024 07:45:50 +0300 Subject: [PATCH] Resolved #11481 - Safeguard against uniques specifying non-existant promotions --- core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt b/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt index 138232e4e3..554e25977b 100644 --- a/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt +++ b/core/src/com/unciv/logic/map/mapunit/UnitPromotions.kt @@ -64,7 +64,7 @@ class UnitPromotions : IsPartOfGameInfoSerialization { fun addPromotion(promotionName: String, isFree: Boolean = false) { val ruleset = unit.civ.gameInfo.ruleset - val promotion = ruleset.unitPromotions[promotionName]!! + val promotion = ruleset.unitPromotions[promotionName] ?: return if (!isFree) { if (!promotion.hasUnique(UniqueType.FreePromotion)) {