Marino Faggiana 7 年之前
父节点
当前提交
b41229920b
共有 1 个文件被更改,包括 6 次插入7 次删除
  1. 6 7
      PickerFileProvider/FileProvider.swift

+ 6 - 7
PickerFileProvider/FileProvider.swift

@@ -283,10 +283,6 @@ class FileProvider: NSFileProviderExtension {
                     return
                 }
                 
-                guard let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account = %@ AND serverUrl = %@", account, serverUrl)) else {
-                    return
-                }
-                
                 uploading.append(identifier.rawValue)
                 
                 _ =  ocNetworking?.uploadFileNameServerUrl(serverUrl+"/"+fileName, fileNameLocalPath: url.path, success: { (fileID, etag, date) in
@@ -315,10 +311,13 @@ class FileProvider: NSFileProviderExtension {
                     
                     self.uploading = self.uploading.filter() { $0 != identifier.rawValue }
                     
-                    let itemDirectory = NSFileProviderItemIdentifier(directory.fileID)
-                    NSFileProviderManager.default.signalEnumerator(for: itemDirectory, completionHandler: { (error) in
+                    if let directory = NCManageDatabase.sharedInstance.getTableDirectory(predicate: NSPredicate(format: "account = %@ AND serverUrl = %@", account, serverUrl)) {
+                    
+                        let itemDirectory = NSFileProviderItemIdentifier(directory.fileID)
+                        NSFileProviderManager.default.signalEnumerator(for: itemDirectory, completionHandler: { (error) in
                         //
-                    })
+                        })
+                    }
                     
                 }, failure: { (message, errorCode) in