changeset 35486:7b090d0f253b

Only ask for playlist position if there is an item.
author ib
date Mon, 03 Dec 2012 14:40:20 +0000
parents 4d2ebecd1605
children 58a221f73d75
files gui/ui/gtk/playlist.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/gui/ui/gtk/playlist.c	Mon Dec 03 14:12:13 2012 +0000
+++ b/gui/ui/gtk/playlist.c	Mon Dec 03 14:40:20 2012 +0000
@@ -194,16 +194,16 @@
  {
   case 1: // ok
        {
-	int pos, i;
+	int pos = 0, i;
 	plItem curr, * item, * old;
 	item = listMgr( PLAYLIST_ITEM_GET_CURR,0 );
 	if (item)
 	 {
 	  curr.path = gstrdup(item->path);
 	  curr.name = gstrdup(item->name);
+	  pos = (int) listMgr( PLAYLIST_ITEM_GET_POS,item );
 	 }
 	else curr.path = curr.name = NULL;
-	pos = (int) listMgr( PLAYLIST_ITEM_GET_POS,item );
 	listMgr( PLAYLIST_DELETE,0 );
 	for ( i=0;i<NrOfSelected;i++ )
 	 {