wxwidgets: fix crash in playlist due to change in meta behaviour (all metas used...
authorDamien Fouilleul <damienf@videolan.org>
Wed, 5 Sep 2007 12:07:33 +0000 (12:07 +0000)
committerDamien Fouilleul <damienf@videolan.org>
Wed, 5 Sep 2007 12:07:33 +0000 (12:07 +0000)
modules/gui/wxwidgets/dialogs/playlist.cpp

index 4649e20..9b870df 100644 (file)
@@ -525,7 +525,7 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
                          wxU( " )" ) );
     }
 
-    if( !strcmp( psz_artist, "" ) || p_item->p_input->b_fixed_name == VLC_TRUE )
+    if( !psz_artist || !strcmp( psz_artist, "" ) || p_item->p_input->b_fixed_name == VLC_TRUE )
     {
         msg = wxString( wxU( psz_name ) ) + duration;
     }
@@ -534,7 +534,8 @@ void Playlist::UpdateTreeItem( wxTreeItemId item )
         msg = wxString(wxU( psz_artist )) + wxT(" - ") +
               wxString(wxU(psz_name)) + duration;
     }
-    free( psz_artist );
+    if( psz_artist )
+        free( psz_artist );
     free( psz_name );
     treectrl->SetItemText( item , msg );
     treectrl->SetItemImage( item, p_item->p_input->i_type );