File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Sources/ManagedModels/SchemaCompatibility Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -66,7 +66,10 @@ final class CodableBox<T: Codable>: NSObject, NSCopying {
6666
6767 override func transformedValue( _ value: Any ? ) -> Any ? {
6868 // value is the box
69- guard let value else { return nil }
69+ guard var value else { return nil }
70+ if let baseTyped = value as? T {
71+ value = CodableBox < T > ( baseTyped)
72+ }
7073 guard let typed = value as? CodableBox < T > else {
7174 assertionFailure ( " Value to be transformed is not the box? \( value) " )
7275 return nil
@@ -77,7 +80,7 @@ final class CodableBox<T: Codable>: NSObject, NSCopying {
7780 override func reverseTransformedValue( _ value: Any ? ) -> Any ? {
7881 guard let value else { return nil }
7982 guard let data = value as? Data else { return nil }
80- return CodableBox < T > ( data: data)
83+ return CodableBox < T > ( data: data) ? . value
8184 }
8285 }
8386}
You can’t perform that action at this time.
0 commit comments