From 40d3a1de7ab51ba9d113422a6e8e86ccc3f2d0cd Mon Sep 17 00:00:00 2001 From: Garrett Moon Date: Wed, 1 Mar 2017 19:51:16 -0800 Subject: [PATCH] Trying to set the progress block with a nil identifire doesn't make sense. (#3117) --- Source/ASNetworkImageNode.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/ASNetworkImageNode.mm b/Source/ASNetworkImageNode.mm index e151fa406a..40e4bbf5b8 100755 --- a/Source/ASNetworkImageNode.mm +++ b/Source/ASNetworkImageNode.mm @@ -439,7 +439,9 @@ static const CGSize kMinReleaseImageOnBackgroundSize = {20.0, 20.0}; if (clearAndReattempt) { // In this case another thread changed the _downloadIdentifierForProgressBlock before we finished registering // the new progress block for newDownloadIDForProgressBlock ID. Let's clear it now and reattempt to register - [_downloader setProgressImageBlock:nil callbackQueue:dispatch_get_main_queue() withDownloadIdentifier:newDownloadIDForProgressBlock]; + if (newDownloadIDForProgressBlock) { + [_downloader setProgressImageBlock:nil callbackQueue:dispatch_get_main_queue() withDownloadIdentifier:newDownloadIDForProgressBlock]; + } [self _updateProgressImageBlockOnDownloaderIfNeeded]; } }