From b3ccd59c5e7f8fa1614eabeb0020502bd876fe74 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 13 Sep 2009 12:07:22 +0200 Subject: [PATCH] screen_search, screen_outputs: added connection==NULL checks Don't attempt to call MPD when there is no connection. --- src/screen_outputs.c | 3 +++ src/screen_search.c | 3 +++ 2 files changed, 6 insertions(+) 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); -- 2.30.2