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 {
1818 public var allowsSave = true
1919
2020 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+ }
2231 get { path == " /dev/null " }
2332 }
2433
@@ -63,7 +72,6 @@ public struct ModelConfiguration: Hashable {
6372 self . cloudKitDatabase = cloudKitDatabase
6473 self . schema = schema
6574 self . allowsSave = allowsSave
66- self . isStoredInMemoryOnly = isStoredInMemoryOnly
6775 }
6876}
6977
You can’t perform that action at this time.
0 commit comments