marinofaggiana 4 年之前
父节点
当前提交
0de19e5703
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      iOSClient/Main/Collection/NCCollectionCommon.swift

+ 2 - 2
iOSClient/Main/Collection/NCCollectionCommon.swift

@@ -250,8 +250,8 @@ class NCCollectionCommon: NSObject {
             var totalBytes: Double = 0.0
             var totalBytes: Double = 0.0
             let progressArray = appDelegate.listProgressMetadata.object(forKey: metadata.ocId) as? NSArray
             let progressArray = appDelegate.listProgressMetadata.object(forKey: metadata.ocId) as? NSArray
             if progressArray != nil && progressArray?.count == 3 {
             if progressArray != nil && progressArray?.count == 3 {
-                progress = progressArray?.object(at: 0) as! Float
-                totalBytes = progressArray?.object(at: 1) as! Double
+                progress = progressArray?.object(at: 0) as? Float ?? 0
+                totalBytes = progressArray?.object(at: 1) as? Double ?? 0
             }
             }
             if metadata.status == k_metadataStatusInDownload || metadata.status == k_metadataStatusDownloading ||  metadata.status >= k_metadataStatusTypeUpload {
             if metadata.status == k_metadataStatusInDownload || metadata.status == k_metadataStatusDownloading ||  metadata.status >= k_metadataStatusTypeUpload {
                 cell.progressView.isHidden = false
                 cell.progressView.isHidden = false