Skip to content

Commit 46bc521

Browse files
Mo Wangfacebook-github-bot
Mo Wang
authored andcommitted
fix the crash caused by nil partialLoadHandler
Summary: ## Problem the partialLoadHandler is nil on line 338 of RCTImageLoader, therefore, if there is a cached image, it would crash on line 495. ## Change Check if partialLoadHandler is nil on line 495 to prevent the crash Changelog: [iOS][Changed] - fix the crash caused by nil partialLoadHandler Reviewed By: appden Differential Revision: D34544090 fbshipit-source-id: f9965700e529c5add1e25867a3772c053447d99a
1 parent 5980abf commit 46bc521

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Libraries/Image/RCTImageLoader.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ - (RCTImageURLLoaderRequest *)_loadImageOrDataWithURLRequest:(NSURLRequest *)req
492492
BOOL cacheResult = [loadHandler respondsToSelector:@selector(shouldCacheLoadedImages)] ?
493493
[loadHandler shouldCacheLoadedImages] : YES;
494494

495-
if (cacheResult) {
495+
if (cacheResult && partialLoadHandler) {
496496
UIImage *image = [[self imageCache] imageForUrl:request.URL.absoluteString
497497
size:size
498498
scale:scale

0 commit comments

Comments
 (0)