Commit 7c52736e authored by Clément Stenac's avatar Clément Stenac

Fix wxWidgets crash

parent 1bef5113
...@@ -1183,7 +1183,8 @@ void Playlist::OnActivateItem( wxTreeEvent& event ) ...@@ -1183,7 +1183,8 @@ void Playlist::OnActivateItem( wxTreeEvent& event )
else else
{ {
p_node = p_wxitem->p_item; p_node = p_wxitem->p_item;
if( p_wxitem->p_item->i_children > 0 ) if( p_wxitem->p_item->i_children > 0 &&
p_wxitem->p_item->pp_children[0]->i_children == -1)
{ {
p_item = p_wxitem->p_item->pp_children[0]; p_item = p_wxitem->p_item->pp_children[0];
} }
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#define TITLE_ALL N_( "All items, unsorted" ) #define TITLE_ALL N_( "All items, unsorted" )
#define PLAYLIST_PROFILE 1 #define PLAYLIST_PROFILE 1
#undef PLAYLIST_DEBUG
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
...@@ -729,6 +730,9 @@ static playlist_item_t * NextItem( playlist_t *p_playlist ) ...@@ -729,6 +730,9 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
/* We are not playing from a view */ /* We are not playing from a view */
if( p_playlist->request.i_view == -1 ) if( p_playlist->request.i_view == -1 )
{ {
#ifdef PLAYLIST_DEBUG
msg_Dbg( p_playlist, "non-view mode request");
#endif
/* Directly select the item, just like now */ /* Directly select the item, just like now */
i_skip = p_playlist->request.i_skip; i_skip = p_playlist->request.i_skip;
i_goto = p_playlist->request.i_goto; i_goto = p_playlist->request.i_goto;
...@@ -755,6 +759,9 @@ static playlist_item_t * NextItem( playlist_t *p_playlist ) ...@@ -755,6 +759,9 @@ static playlist_item_t * NextItem( playlist_t *p_playlist )
} }
else else
{ {
#ifdef PLAYLIST_DEBUG
msg_Dbg( p_playlist, "view mode request" );
#endif
p_new = p_playlist->request.p_item; p_new = p_playlist->request.p_item;
i_skip = p_playlist->request.i_skip; i_skip = p_playlist->request.i_skip;
......
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