diff --git a/React/Base/RCTUtils.m b/React/Base/RCTUtils.m index 44e1e7fe5c1730..37fff6a2a530e0 100644 --- a/React/Base/RCTUtils.m +++ b/React/Base/RCTUtils.m @@ -708,13 +708,11 @@ BOOL RCTIsLocalAssetURL(NSURL *__nullable imageURL) if (!image) { // Attempt to load from the file system - NSData *fileData; - if (imageURL.pathExtension.length == 0) { - fileData = [NSData dataWithContentsOfURL:[imageURL URLByAppendingPathExtension:@"png"]]; - } else { - fileData = [NSData dataWithContentsOfURL:imageURL]; + NSString *filePath = [NSString stringWithUTF8String:[imageURL fileSystemRepresentation]]; + if (filePath.pathExtension.length == 0) { + filePath = [filePath stringByAppendingPathExtension:@"png"]; } - image = [UIImage imageWithData:fileData]; + image = [UIImage imageWithContentsOfFile:filePath]; } if (!image && !bundle) {