File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Sources/ManagedModels/Container Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,16 @@ public struct ModelConfiguration: Hashable {
18
18
public var allowsSave = true
19
19
20
20
public var isStoredInMemoryOnly : Bool {
21
- set { path = newValue ? " /dev/null " : try ! lookupDefaultPath ( for: name) }
21
+ set {
22
+ if newValue {
23
+ path = " /dev/null "
24
+ }
25
+ else if path == " /dev/null " {
26
+ do { path = try lookupDefaultPath ( for: name) }
27
+ catch { fatalError ( " Could not lookup path for: \( name) \( error) " ) }
28
+ }
29
+ // else: preserve existing path
30
+ }
22
31
get { path == " /dev/null " }
23
32
}
24
33
@@ -63,7 +72,6 @@ public struct ModelConfiguration: Hashable {
63
72
self . cloudKitDatabase = cloudKitDatabase
64
73
self . schema = schema
65
74
self . allowsSave = allowsSave
66
- self . isStoredInMemoryOnly = isStoredInMemoryOnly
67
75
}
68
76
}
69
77
You can’t perform that action at this time.
0 commit comments