mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
Attempt to fix RCTImageLoader crash
Reviewed By: jspahrsummers Differential Revision: D2620944 fb-gh-sync-id: 39896c8aa6f162df5769afdd0f947acf4bb5cb76
This commit is contained in:
committed by
facebook-github-bot-5
parent
b3cfc598ce
commit
8db1e1262e
@@ -224,7 +224,16 @@ RCT_EXPORT_MODULE()
|
||||
__weak RCTImageLoader *weakSelf = self;
|
||||
__block RCTImageLoaderCancellationBlock decodeCancel = nil;
|
||||
RCTURLRequestCompletionBlock processResponse =
|
||||
^(NSURLResponse *response, NSData *data, __unused NSError *error) {
|
||||
^(NSURLResponse *response, NSData *data, NSError *error) {
|
||||
|
||||
// Check for system errors
|
||||
if (error) {
|
||||
completionHandler(error, nil);
|
||||
return;
|
||||
} else if (!data) {
|
||||
completionHandler(RCTErrorWithMessage(@"Unknown image download error"), nil);
|
||||
return;
|
||||
}
|
||||
|
||||
// Check for http errors
|
||||
if ([response isKindOfClass:[NSHTTPURLResponse class]]) {
|
||||
|
||||
Reference in New Issue
Block a user