(fix/states) prevent nil error when cleaning up states

This commit is contained in:
NoM0Re
2025-04-26 16:10:06 +02:00
parent 709671d706
commit 253de34f0f
+1 -1
View File
@@ -801,7 +801,7 @@ local function RunTriggerFunc(allStates, data, id, triggernum, event, arg1, arg2
end
end
end
if not updateTriggerState and not allStates[cloneIdForUnitTrigger].show then
if not updateTriggerState and not (allStates[cloneIdForUnitTrigger] and allStates[cloneIdForUnitTrigger].show) then
-- We added this state automatically, but the trigger didn't end up using it,
-- so remove it again
allStates[cloneIdForUnitTrigger] = nil