Commit 81705747 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: add missing sanity check

parent 184723ed
...@@ -498,8 +498,12 @@ error: ...@@ -498,8 +498,12 @@ error:
if (i_object_id == -1) { if (i_object_id == -1) {
vlc_mutex_lock(&p_item->lock); vlc_mutex_lock(&p_item->lock);
for (int i = 0 ; i < p_item->i_categories ; i++) { for (int i = 0 ; i < p_item->i_categories ; i++) {
NSString * name = [NSString stringWithUTF8String:p_item->pp_categories[i]->psz_name]; NSString *name;
VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] if (p_item->pp_categories[i]->psz_name)
name = [NSString stringWithUTF8String:p_item->pp_categories[i]->psz_name];
else
name = @"";
VLCInfoTreeItem *item = [[VLCInfoTreeItem alloc]
initWithName:name initWithName:name
value:@"" value:@""
ID:i ID:i
...@@ -514,9 +518,17 @@ error: ...@@ -514,9 +518,17 @@ error:
vlc_mutex_lock(&p_item->lock); vlc_mutex_lock(&p_item->lock);
info_category_t * cat = p_item->pp_categories[i_object_id]; info_category_t * cat = p_item->pp_categories[i_object_id];
for (int i = 0 ; i < cat->i_infos ; i++) { for (int i = 0 ; i < cat->i_infos ; i++) {
NSString * name = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_name]; NSString *name;
NSString * value = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_value ? : ""]; NSString *value;
VLCInfoTreeItem * item = [[VLCInfoTreeItem alloc] if (cat->pp_infos[i]->psz_name != NULL)
name = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_name];
else
name = @"";
if (cat->pp_infos[i]->psz_value != NULL)
value = [NSString stringWithUTF8String:cat->pp_infos[i]->psz_value];
else
value = @"";
VLCInfoTreeItem *item = [[VLCInfoTreeItem alloc]
initWithName:name initWithName:name
value:value value:value
ID:i ID:i
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment