浏览代码

more control error nil

Marino Faggiana 8 年之前
父节点
当前提交
10bbf011a5
共有 1 个文件被更改,包括 5 次插入1 次删除
  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