Explorar o código

more control error nil

Marino Faggiana %!s(int64=8) %!d(string=hai) anos
pai
achega
10bbf011a5
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  1. 5 1
      iOSClient/FileSystem/NCManageDatabase.swift

+ 5 - 1
iOSClient/FileSystem/NCManageDatabase.swift

@@ -243,7 +243,11 @@ class NCManageDatabase: NSObject {
                 let addActivity = tableActivity()
                 
                 addActivity.account = account
-                addActivity.date = activity.date! as NSDate
+                
+                if activity.date != nil {
+                    addActivity.date = activity.date! as NSDate
+                }
+                
                 addActivity.idActivity = Double(activity.idActivity)
                 addActivity.link = activity.link
                 addActivity.note = activity.subject