Skip to content

Commit 88a57ce

Browse files
author
jianglei
committed
crashfix: SDImageIOAnimatedCoder crash
1 parent cac9a55 commit 88a57ce

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SDWebImage/Private/SDImageFramePool.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,16 @@ - (void)prefetchFrameAtIndex:(NSUInteger)index {
109109

110110
if (self.fetchQueue.operationCount == 0) {
111111
// Prefetch next frame in background queue
112-
id<SDAnimatedImageProvider> animatedProvider = self.provider;
113112
@weakify(self);
114113
NSOperation *operation = [NSBlockOperation blockOperationWithBlock:^{
115114
@strongify(self);
116115
if (!self) {
117116
return;
118117
}
118+
id<SDAnimatedImageProvider> animatedProvider = self.provider;
119+
if (!animatedProvider) {
120+
return;
121+
}
119122
UIImage *frame = [animatedProvider animatedImageFrameAtIndex:index];
120123

121124
[self setFrame:frame atIndex:index];

0 commit comments

Comments
 (0)