[ASImageNode+AnimatedImage] Fix early return when animatedImage is nil in setAnimatedImage #trivial #925
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey guys,
I recently tried to update to
master
and ran into an issue where thedefaultImage
s I set in myASNetworkImageNode
are replaced bynil
when they leave the preload range.It turns out, #896 does not take into account the case where the
animatedImage
might benil
. Hence the call to_locked_setAnimatedImage
no longer performs an early return like it used to, becauseanimatedImage.playbackReady
isNO
.This PR fixes this and gives me back my
defaultImage
s, even after they've gone out of the preload range and back. :-DThis time I haven't set up a sample project like I usually do, but I made up for it by adding a new test, yay! This test shows that the
defaultImage
is currently incorrectly set tonil
when theASNetworkImageNode
leaves the preload range.I've also slightly improved the (very similar) existing test for the
image
property, becausedidExitPreloadState
wasn't actually called (see the diff and the related comment).Please tell me how this looks and if I can improve anything!
Cheers,
Flo