From 360f52d0cfc79384fc561b8c8423ebf63dc7c7ba Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 25 Apr 2022 18:49:45 -0400 Subject: [PATCH] Don't crash when saving persistent store fails --- Tusker/MainSceneDelegate.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tusker/MainSceneDelegate.swift b/Tusker/MainSceneDelegate.swift index 3e7d65344c..4b6265eb01 100644 --- a/Tusker/MainSceneDelegate.swift +++ b/Tusker/MainSceneDelegate.swift @@ -116,7 +116,7 @@ class MainSceneDelegate: UIResponder, UIWindowSceneDelegate { rootVC.sceneDidEnterBackground() } - try! scene.session.mastodonController?.persistentContainer.viewContext.save() + try? scene.session.mastodonController?.persistentContainer.viewContext.save() } private func handlePendingCrashReport(_ report: PLCrashReport, session: UISceneSession) {