ソースを参照

add catch on db

Marino Faggiana 8 年 前
コミット
ec5c7b9358
1 ファイル変更5 行追加1 行削除
  1. 5 1
      iOSClient/Database/NCManageDatabase.swift

+ 5 - 1
iOSClient/Database/NCManageDatabase.swift

@@ -72,7 +72,11 @@ class NCManageDatabase: NSObject {
     
         realm.delete(results)
 
-        try! realm.commitWrite()
+        do {
+            try realm.commitWrite()
+        } catch let error {
+            print("[LOG] Could not write to database: ", error)
+        }
     }
     
     func removeDB() {