From b0a243b865039e4e007942ee8ced76cfb12dbd94 Mon Sep 17 00:00:00 2001 From: ws Date: Fri, 17 Dec 2021 14:28:03 +0800 Subject: [PATCH] Fix the problem of CRC verification failure caused by network disconnection in resumableupload --- AliyunOSSSDK/OSSClient.m | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/AliyunOSSSDK/OSSClient.m b/AliyunOSSSDK/OSSClient.m index f3872ca..e2b7676 100644 --- a/AliyunOSSSDK/OSSClient.m +++ b/AliyunOSSSDK/OSSClient.m @@ -1608,10 +1608,12 @@ - (OSSTask *)multipartUpload:(OSSMultipartUploadRequest *)request resumable:(BOO #pragma clang diagnostic pop NSDictionary *tPartInfo = [localPartInfos objectForKey: [@(remotePartNumber) stringValue]]; - info.crc64 = [tPartInfo[@"crc64"] unsignedLongLongValue]; - - [uploadedPartInfos addObject:info]; - [alreadyUploadIndex addObject:@(remotePartNumber)]; + if (tPartInfo != nil) { + info.crc64 = [tPartInfo[@"crc64"] unsignedLongLongValue]; + + [uploadedPartInfos addObject:info]; + [alreadyUploadIndex addObject:@(remotePartNumber)]; + } }]; if ([alreadyUploadIndex count] > 0 && request.uploadProgress && uploadFileSize) {