diff --git a/MVMCore/MVMCore/Models/Extensions/Decoder.swift b/MVMCore/MVMCore/Models/Extensions/Decoder.swift index e4b5863..ca66508 100644 --- a/MVMCore/MVMCore/Models/Extensions/Decoder.swift +++ b/MVMCore/MVMCore/Models/Extensions/Decoder.swift @@ -28,6 +28,9 @@ extension Data { extension JSONDecoder { /// Decodes a top-level value of the given type from the given JSON representation, and adds the delegate object if provided. func decode(_ type: T.Type, from data: Data, delegateObject: DelegateObject?) throws -> T where T : Decodable { + if context == nil { + add(value: DecodingContext(), for: .contextKey) + } if let delegateObject = delegateObject { add(value: delegateObject, for: .delegateObjectKey) }