summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5a75328)
raw | patch | inline | side by side (parent: 5a75328)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Fri, 10 Aug 2012 11:21:39 +0000 (13:21 +0200) | ||
committer | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Fri, 10 Aug 2012 11:21:39 +0000 (13:21 +0200) |
It crashed without this patch.
NEWS | patch | blob | history | |
src/screen_queue.c | patch | blob | history |
index 59ee50855cc40bc3ed4554be1c1f7d72f3710c03..59c0c84cf8b01366c0614defd5d46b45b751660f 100644 (file)
--- a/NEWS
+++ b/NEWS
* add a chat screen for communication with other clients on the same server
* song format: evaluate literal strings as true
* fix crash on search screen when disconnected
+* screen_queue: fix crash on CMD_SCREEN_SWAP when the queue is empty
ncmpc 0.20 - (02/05/2012)
diff --git a/src/screen_queue.c b/src/screen_queue.c
index 9b67592356bd89796d9922e47cbcddc81dfbaa83..50e70c4a51ddcb3a321db52455cdb3d2f9afc440 100644 (file)
--- a/src/screen_queue.c
+++ b/src/screen_queue.c
break;
#endif
case CMD_SCREEN_SWAP:
- screen_swap(c, playlist_get(&c->playlist, lw->selected));
+ if (playlist_length(&c->playlist) > 0)
+ screen_swap(c, playlist_get(&c->playlist, lw->selected));
+ else
+ screen_swap(c, NULL);
return true;
default: