summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6d0a673)
raw | patch | inline | side by side (parent: 6d0a673)
author | Max Kellermann <max@duempel.org> | |
Sat, 17 Oct 2009 22:01:18 +0000 (00:01 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sat, 17 Oct 2009 22:01:18 +0000 (00:01 +0200) |
src/screen_artist.c | patch | blob | history |
diff --git a/src/screen_artist.c b/src/screen_artist.c
index a12b26303c772a1e83bdb6dd434d8d3733dd4d0a..a3bda330ef9fb22877fe6ce3347418d46837cfe1 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
assert(album != NULL);
assert(browser.filelist == NULL);
- mpd_search_db_songs(connection, true);
- mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
- MPD_TAG_ARTIST, artist);
- if (album[0] != 0)
- mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
- MPD_TAG_ALBUM, album);
- mpd_search_commit(connection);
-
browser.filelist = filelist_new();
/* add a dummy entry for ".." */
filelist_append(browser.filelist, NULL);
- filelist_recv(browser.filelist, connection);
+ if (connection != NULL) {
+ mpd_search_db_songs(connection, true);
+ mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
+ MPD_TAG_ARTIST, artist);
+ if (album[0] != 0)
+ mpd_search_add_tag_constraint(connection, MPD_OPERATOR_DEFAULT,
+ MPD_TAG_ALBUM, album);
+ mpd_search_commit(connection);
+
+ filelist_recv(browser.filelist, connection);
- if (!mpd_response_finish(connection))
- mpdclient_handle_error(c);
+ if (!mpd_response_finish(connection))
+ mpdclient_handle_error(c);
+ }
#ifndef NCMPC_MINI
/* fix highlights */