소스 검색

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

cyberta 4 년 전
부모
커밋
e60ab7ff21
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  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")