From 7b5ed07805edff2ffab167bf813056140362db9b Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 7 May 2023 09:52:59 +0300 Subject: [PATCH] Resolved #9333 - Improperly configured mod conditionals do not cause crash --- core/src/com/unciv/models/ruleset/unique/Unique.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/com/unciv/models/ruleset/unique/Unique.kt b/core/src/com/unciv/models/ruleset/unique/Unique.kt index cef3cf3dbc..1bda8ee71d 100644 --- a/core/src/com/unciv/models/ruleset/unique/Unique.kt +++ b/core/src/com/unciv/models/ruleset/unique/Unique.kt @@ -125,7 +125,7 @@ class Unique(val text: String, val sourceObjectType: UniqueTarget? = null, val s ): Boolean { val nonConditionalConditionTypes = setOf(UniqueTarget.TriggerCondition, UniqueTarget.UnitTriggerCondition, UniqueTarget.UnitActionModifier) - if (condition.type!!.targetTypes.any { it in nonConditionalConditionTypes }) + if (condition.type?.targetTypes?.any { it in nonConditionalConditionTypes } == true) return true // not a filtering condition fun ruleset() = state.civInfo!!.gameInfo.ruleset