From: Max Kellermann Date: Wed, 1 Aug 2012 08:11:52 +0000 (+0200) Subject: screen_search: fix crash when disconnected X-Git-Tag: release-0.21~18 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=c5d401b3145e54749d9754ed48b887180a81c9ae;p=ncmpc.git screen_search: fix crash when disconnected --- diff --git a/NEWS b/NEWS index ab2d7b5..59ee508 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ncmpc 0.21 - not yet released * 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 ncmpc 0.20 - (02/05/2012) diff --git a/src/screen_search.c b/src/screen_search.c index 81ca8e4..3abda9d 100644 --- a/src/screen_search.c +++ b/src/screen_search.c @@ -293,9 +293,10 @@ static struct filelist * do_search(struct mpdclient *c, char *query) { struct mpd_connection *connection = mpdclient_get_connection(c); - struct filelist *fl; + if (connection == NULL) + return NULL; - fl = search_advanced_query(connection, query); + struct filelist *fl = search_advanced_query(connection, query); if (fl != NULL) return fl;