summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/playlist.c b/playlist.c
index a9ae7b23..2205c0ef 100644
--- a/playlist.c
+++ b/playlist.c
@@ -409,12 +409,18 @@ plt_remove (int plt) {
prev->next = p->next;
}
}
+ playlist_t *next = p->next;
playlist_t *old = playlist;
playlist = p;
pl_clear ();
playlist = old;
if (p == playlist) {
- playlist = prev ? prev : playlists_head;
+ if (next) {
+ playlist = next;
+ }
+ else {
+ playlist = prev ? prev : playlists_head;
+ }
}
free (p->title);
free (p);