summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9a244cf)
raw | patch | inline | side by side (parent: 9a244cf)
author | Max Kellermann <max@duempel.org> | |
Fri, 27 Mar 2009 18:21:15 +0000 (19:21 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 27 Mar 2009 18:21:15 +0000 (19:21 +0100) |
When the connection to the MPD server is closed, c->status may become
NULL. All of the ncmpc code has to check that, including the song
screen.
NULL. All of the ncmpc code has to check that, including the song
screen.
src/screen_song.c | patch | blob | history |
diff --git a/src/screen_song.c b/src/screen_song.c
index 74d2652728ccfd1d142be267bf48a5358c390adf..e415a6c4cbc2692da30a9a02639a93bc588111a6 100644 (file)
--- a/src/screen_song.c
+++ b/src/screen_song.c
if (current.selected_song != NULL &&
(c->song == NULL ||
g_strcmp0(current.selected_song->file, c->song->file) != 0 ||
+ c->status == NULL ||
(c->status->state != MPD_STATUS_STATE_PLAY &&
c->status->state != MPD_STATUS_STATE_PAUSE)) ) {
g_ptr_array_add(current.lines, g_strdup(_("Selected song")) );
g_ptr_array_add(current.lines, g_strdup("\0"));
}
- if (c->song != NULL &&
+ if (c->song != NULL && c->status != NULL &&
(c->status->state == MPD_STATUS_STATE_PLAY ||
c->status->state == MPD_STATUS_STATE_PAUSE) ) {
if (current.played_song != NULL) {