summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 54f4d47)
raw | patch | inline | side by side (parent: 54f4d47)
author | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:44:04 +0000 (22:44 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:44:04 +0000 (22:44 +0200) |
Don't try to call add_query() with no valid selection, this causes a
segfault. This usually happens when ncmpc isn't connected.
segfault. This usually happens when ncmpc isn't connected.
src/screen_artist.c | patch | blob | history |
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 71be6f408603f67596307b2ac3cad59b47f2e786..2f97c723a7d7b70293f4c670f82911f4f4f0569c 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
char *str;
mpdclient_filelist_t *addlist;
+ assert(filter != NULL);
+
str = utf8_to_locale(_filter);
if (table== MPD_TABLE_ALBUM)
screen_status_printf("Adding album %s...", str);
case LIST_ARTISTS:
selected = g_list_nth_data(metalist,
browser.lw->selected);
+ if (selected == NULL)
+ return 1;
+
add_query(c, MPD_TABLE_ARTIST, selected);
cmd = CMD_LIST_NEXT; /* continue and select next item... */
break;
else if (browser.lw->selected > 0) {
selected = g_list_nth_data(metalist,
browser.lw->selected);
+ if (selected == NULL)
+ return 1;
+
add_query(c, MPD_TABLE_ALBUM, selected);
cmd = CMD_LIST_NEXT; /* continue and select next item... */
}