diff --git a/src/screen_search.c b/src/screen_search.c
index cff0b9da276e9b2314f74d5f38d6109c9587091a..3abda9d9c574e116c5e417043f100f866250a1ef 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
/* ncmpc (Ncurses MPD Client)
* (c) 2004-2010 The Music Player Daemon Project
* Project homepage: http://musicpd.org
-
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
-
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
-
+ *
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
+ */
#include "screen_search.h"
#include "screen_interface.h"
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;
// search_new(screen, c);
// else
screen_status_printf(_("Press %s for a new search"),
- get_key_names(CMD_SCREEN_SEARCH,0));
+ get_key_names(CMD_SCREEN_SEARCH, false));
search_check_mode();
}
_(mode[options.search_mode].label));
else
g_snprintf(str, size, _("Search: Press %s for a new search [%s]"),
- get_key_names(CMD_SCREEN_SEARCH,0),
+ get_key_names(CMD_SCREEN_SEARCH, false),
_(mode[options.search_mode].label));
return str;