Skip to content

Commit f69231f

Browse files
authored
Merge pull request #1246 from niklassaers/master
Instead of crashing, show a warning and return
2 parents 98eb7a3 + 075dfba commit f69231f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ios/Video/RCTVideo.m

+4
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,10 @@ - (void)playerItemForSource:(NSDictionary *)source withCallback:(void(^)(AVPlaye
467467
bool shouldCache = [RCTConvert BOOL:[source objectForKey:@"shouldCache"]];
468468
NSString *uri = [source objectForKey:@"uri"];
469469
NSString *type = [source objectForKey:@"type"];
470+
if (!uri || [uri isEqualToString:@""]) {
471+
DebugLog(@"Could not find video URL in source '%@'", source);
472+
return;
473+
}
470474

471475
NSURL *url = isNetwork || isAsset
472476
? [NSURL URLWithString:uri]

0 commit comments

Comments
 (0)