From 34d43bc0a8e8d83283b0a598a27812f970179489 Mon Sep 17 00:00:00 2001 From: david-swift Date: Tue, 3 Sep 2024 06:33:07 +0200 Subject: [PATCH] Fix state storage not initializing when writing --- Sources/Model/Data Flow/State.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Sources/Model/Data Flow/State.swift b/Sources/Model/Data Flow/State.swift index 32d5c4d..6216223 100644 --- a/Sources/Model/Data Flow/State.swift +++ b/Sources/Model/Data Flow/State.swift @@ -51,6 +51,9 @@ public struct State: StateProtocol { return value } nonmutating set { + if content.storage == nil { + _ = rawValue + } content.value = newValue } }