Skip to content
This repository has been archived by the owner on Mar 29, 2022. It is now read-only.

Crash fix when YouTube server answer isn’t expected #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion YoutubeParser/Classes/HCYoutubeParser.m
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ + (NSDictionary *)h264videosWithYoutubeID:(NSString *)youtubeID {

for (NSString *key in keys)
{
[optionsDict setObject:parts[key][0] forKey:key]; // [0] because we want the object and not the array
if ([parts objectForKey:key] &&
[[parts objectForKey:key] count] > 0) {
[optionsDict setObject:parts[key][0] forKey:key]; // [0] because we want the object and not the array
}
}

[videoDictionary setObject:optionsDict forKey:@"moreInfo"];
Expand Down