mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-20 00:24:43 +02:00
Log Core Data save errors. Use a static property for the Core Data in memory SQLite URL.
This commit is contained in:
@@ -50,7 +50,7 @@ class URLPreviewStore {
|
||||
|
||||
if inMemory {
|
||||
if let storeDescription = container.persistentStoreDescriptions.first {
|
||||
storeDescription.url = URL(fileURLWithPath: "/dev/null")
|
||||
storeDescription.url = CoreDataHelper.inMemoryURL
|
||||
} else {
|
||||
MXLog.error("[URLPreviewStore] persistentStoreDescription not found.")
|
||||
}
|
||||
@@ -160,6 +160,10 @@ class URLPreviewStore {
|
||||
/// Saves any changes that are found on the context
|
||||
private func save() {
|
||||
guard context.hasChanges else { return }
|
||||
try? context.save()
|
||||
do {
|
||||
try context.save()
|
||||
} catch {
|
||||
MXLog.error("[URLPreviewStore] Error saving changes: \(error.localizedDescription)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user