Merge pull request #3587 from dreampiggy/bugfix/add_check_for_empty_data

Add extra check for empty data during URLSession data callback
This commit is contained in:
DreamPiggy 2023-08-23 18:26:29 +08:00 committed by GitHub
commit 507225ea04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -553,7 +553,7 @@ didReceiveResponse:(NSURLResponse *)response
NSData *imageData = self.imageData;
// keep maximum one progressive decode process during download
if (self.coderQueue.operationCount == 0) {
if (imageData && self.coderQueue.operationCount == 0) {
// NSOperation have autoreleasepool, don't need to create extra one
@weakify(self);
[self.coderQueue addOperationWithBlock:^{
@ -632,7 +632,6 @@ didReceiveResponse:(NSURLResponse *)response
} else {
if (tokens.count > 0) {
NSData *imageData = self.imageData;
self.imageData = nil;
// data decryptor
if (imageData && self.decryptor) {
imageData = [self.decryptor decryptedDataWithData:imageData response:self.response];