浏览代码

add catch on db

Marino Faggiana 7 年之前
父节点
当前提交
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() {