From 1d524052e63bc299fe710f5d6ee97d0235da3a4b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Felix=20Paul=20K=C3=BChne?= Date: Thu, 9 Nov 2006 13:32:45 +0000 Subject: [PATCH] * forward-port [17568] --- modules/gui/macosx/playlist.m | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index f0b374b47f..5066bde075 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -256,11 +256,15 @@ NSLog( @"expandable" ); if( [[o_tc identifier] isEqualToString:@"1"] ) { - o_value = [NSString stringWithUTF8String: - p_item->p_input->psz_name]; - if( o_value == NULL ) - o_value = [NSString stringWithCString: - p_item->p_input->psz_name]; + /* sanity check to prevent the NSString class from crashing */ + if( p_item->input.psz_name != NULL ) + { + o_value = [NSString stringWithUTF8String: + p_item->input.psz_name]; + if( o_value == NULL ) + o_value = [NSString stringWithCString: + p_item->input.psz_name]; + } } else if( [[o_tc identifier] isEqualToString:@"2"] && p_item->p_input->p_meta && p_item->p_input->p_meta->psz_artist && *p_item->p_input->p_meta->psz_artist ) -- 2.39.2