Browse Source

explicitely throw a fatal error, if an account context cannot be created

cyberta 4 years ago
parent
commit
e60ab7ff21
1 changed files with 2 additions and 2 deletions
  1. 2 2
      deltachat-ios/AppDelegate.swift

+ 2 - 2
deltachat-ios/AppDelegate.swift

@@ -58,8 +58,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
 
         dcAccounts.openDatabase()
         migrateToDcAccounts()
-        if dcAccounts.getAll().isEmpty {
-            dcAccounts.add()
+        if dcAccounts.getAll().isEmpty, dcAccounts.add() == 0 {
+           fatalError("Could not initialize a new account.")
         }
         dcAccounts.getSelected().logger = DcLogger()
         logger.info("➡️ didFinishLaunchingWithOptions")