Browse Source

add catch on db

Marino Faggiana 7 năm trước cách đây
mục cha
commit
ec5c7b9358

+ 5 - 1
iOSClient/Database/NCManageDatabase.swift

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