Code

screen_search, screen_outputs: added connection==NULL checks
authorMax Kellermann <max@duempel.org>
Sun, 13 Sep 2009 10:07:22 +0000 (12:07 +0200)
committerMax Kellermann <max@duempel.org>
Sun, 13 Sep 2009 10:07:22 +0000 (12:07 +0200)
Don't attempt to call MPD when there is no connection.

src/screen_outputs.c
src/screen_search.c

index 9b6fa87bc80e4a61f47bf3a40ee41e2e2d330a11..4e55df9fe131fa8927ba89e6114a9f7fe6488404 100644 (file)
@@ -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);
index b8ebbd50927bfcbf9ba49180046b3020cc4f45e1..12bc5f92af755d69c563a0e3832eb06c2420843a 100644 (file)
@@ -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);