Instead of crashing, show a warning and return

This commit is contained in:
Niklas Saers 2018-09-19 12:02:55 +02:00
parent b0c0ac10f4
commit c37507768c

View File

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