From: Max Kellermann Date: Sun, 13 Sep 2009 10:07:22 +0000 (+0200) Subject: screen_search, screen_outputs: added connection==NULL checks X-Git-Tag: release-0.15~11 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=b3ccd59c5e7f8fa1614eabeb0020502bd876fe74;p=ncmpc.git screen_search, screen_outputs: added connection==NULL checks Don't attempt to call MPD when there is no connection. --- diff --git a/src/screen_outputs.c b/src/screen_outputs.c index 9b6fa87..4e55df9 100644 --- a/src/screen_outputs.c +++ b/src/screen_outputs.c @@ -96,6 +96,9 @@ fill_outputs_list(mpdclient_t *c) assert(mpd_outputs != NULL); + if (c->connection == NULL) + return; + mpd_sendOutputsCommand(c->connection); while ((output = mpd_getNextOutput(c->connection)) != NULL) { g_ptr_array_add(mpd_outputs, output); diff --git a/src/screen_search.c b/src/screen_search.c index b8ebbd5..12bc5f9 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -297,6 +297,9 @@ search_advanced_query(char *query, mpdclient_t *c) static void search_new(mpdclient_t *c) { + if (c->connection == NULL) + return; + search_clear(c, TRUE); g_free(pattern);