UIImageView+AFNetworking: Prevent stuck state for malformed urlRequest #4131
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4131 +/- ##
==========================================
+ Coverage 87.69% 87.74% +0.05%
==========================================
Files 46 46
Lines 5706 5730 +24
Branches 295 295
==========================================
+ Hits 5004 5028 +24
Misses 702 702
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks good to me; once this is building cleanly with no CI failures we’re good to go!
@SlaunchaMan from what I can tell, build job #5 failed due to a I'd restart the build job but do not have the proper permissions to do so; would you be able to restart the build job? |
Restarted! |
@SlaunchaMan got my fork UTD w/ master, and pushed a merge into the PR and saw all build jobs failing |
Looks like some certificates expired that we use for tests. I'll update those shortly! |
Tests have been updated. Once you merge in |
|
Addresses issue within
setImageWithURLRequest:placeholderImage:success:failure:
.Issue:
If a
NSURLRequest
object is initialized with a malformed url (eg. passing an uninitialized string intoURLWithString:
), and is passed intosetImageWithUrlRequest:
, neither blocks (success
orfailure
) get fired. When the method encounters anil
URL
property of theNSURLRequest
argument,cancelImageDownloadTask
is called, but it's functionality depends on the existence ofaf_activeImageDownloadReceipt
. In this caseaf_activeImageDownloadReceipt
isnil
, as the early return prevents a download task from starting, thus leaving the method caller waiting.Proposal:
Replace
cancelImageDownloadTask
with the firing of thefailure
block.