Merge pull request #1246 from niklassaers/master

Instead of crashing, show a warning and return
This commit is contained in:
Hampton Maxwell 2019-02-18 21:34:46 -08:00 committed by GitHub
commit f69231fe81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -467,6 +467,10 @@ static int const RCTVideoUnset = -1;
bool shouldCache = [RCTConvert BOOL:[source objectForKey:@"shouldCache"]]; bool shouldCache = [RCTConvert BOOL:[source objectForKey:@"shouldCache"]];
NSString *uri = [source objectForKey:@"uri"]; NSString *uri = [source objectForKey:@"uri"];
NSString *type = [source objectForKey:@"type"]; NSString *type = [source objectForKey:@"type"];
if (!uri || [uri isEqualToString:@""]) {
DebugLog(@"Could not find video URL in source '%@'", source);
return;
}
NSURL *url = isNetwork || isAsset NSURL *url = isNetwork || isAsset
? [NSURL URLWithString:uri] ? [NSURL URLWithString:uri]