ncurses: check playlist_CurrentPlayingItem() return value
authorRafaël Carré <rafael.carre@gmail.com>
Fri, 31 Jul 2009 09:57:27 +0000 (11:57 +0200)
committerRafaël Carré <rafael.carre@gmail.com>
Fri, 31 Jul 2009 09:58:44 +0000 (11:58 +0200)
modules/gui/ncurses.c

index ace16b6..0421a5c 100644 (file)
@@ -2137,9 +2137,11 @@ static void Redraw( intf_thread_t *p_intf, time_t *t_last_refresh )
             input_thread_t *p_input2 = playlist_CurrentInput( p_playlist );
 
             PL_LOCK;
+            assert( p_item );
+            playlist_item_t *p_current_playing_item = playlist_CurrentPlayingItem(p_playlist);
             if( ( p_node && p_item->p_input == p_node->p_input ) ||
-                        ( !p_node && p_input2 &&
-                          p_item->p_input == playlist_CurrentPlayingItem(p_playlist)->p_input ) )
+                        ( !p_node && p_input2 && p_current_playing_item &&
+                          p_item->p_input == p_current_playing_item->p_input ) )
                 c = '*';
             else if( p_item == p_node || ( p_item != p_node &&
                         PlaylistIsPlaying( p_playlist, p_item ) ) )