aboutsummaryrefslogtreecommitdiffstats
path: root/src/screen_play.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen_play.c')
-rw-r--r--src/screen_play.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/screen_play.c b/src/screen_play.c
index c59c766cd..d257ec1db 100644
--- a/src/screen_play.c
+++ b/src/screen_play.c
@@ -80,9 +80,10 @@ list_callback(unsigned idx, int *highlight, void *data)
mpdclient_t *c = (mpdclient_t *) data;
mpd_Song *song;
- if( (song=playlist_get_song(c, idx)) == NULL ) {
+ if (idx >= playlist_length(&c->playlist))
return NULL;
- }
+
+ song = playlist_get(&c->playlist, idx);
if( c->song && song->id==c->song->id && !IS_STOPPED(c->status->state) ) {
*highlight = 1;