summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba91edf)
raw | patch | inline | side by side (parent: ba91edf)
author | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:45:08 +0000 (22:45 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 21 Sep 2008 20:45:08 +0000 (22:45 +0200) |
There are several places where browser.filelist can become NULL.
Catch that everywhere and generate an empty filelist in this case.
Catch that everywhere and generate an empty filelist in this case.
src/screen_artist.c | patch | blob | history | |
src/screen_search.c | patch | blob | history |
diff --git a/src/screen_artist.c b/src/screen_artist.c
index 2f97c723a7d7b70293f4c670f82911f4f4f0569c..cf2d310ce920659afb83eef17a18f8f888808054 100644 (file)
--- a/src/screen_artist.c
+++ b/src/screen_artist.c
mpdclient_filelist_search_utf8(c, TRUE,
MPD_TABLE_ALBUM,
album);
+ if (browser.filelist == NULL)
+ browser.filelist = filelist_new(NULL);
+
/* add a dummy entry for ".." */
filelist_prepend(browser.filelist, NULL);
diff --git a/src/screen_search.c b/src/screen_search.c
index 803772f4fd46535d57add4a439ffdb80fb76deb3..7dfc58d0f05dc85ceb59b5f700fc449309a2da6a 100644 (file)
--- a/src/screen_search.c
+++ b/src/screen_search.c
if (browser.filelist) {
mpdclient_remove_playlist_callback(c, playlist_changed_callback);
filelist_free(browser.filelist);
- browser.filelist = NULL;
+ browser.filelist = filelist_new(NULL);
}
if (clear_pattern && pattern) {
g_free(pattern);
if (table == SEARCH_ARTIST_TITLE) {
list = mpdclient_filelist_search(c, FALSE, MPD_TABLE_ARTIST,
local_pattern);
+ if (list == NULL)
+ list = filelist_new(NULL);
+
list2 = mpdclient_filelist_search(c, FALSE, MPD_TABLE_TITLE,
local_pattern);
+ if (list2 != NULL) {
+ filelist_move(list, list2);
+ filelist_free(list2);
+ }
- filelist_move(list, list2);
- filelist_free(list2);
filelist_sort(list, compare_filelistentry_format);
list->updated = TRUE;
- } else
+ } else {
list = mpdclient_filelist_search(c, FALSE, table, local_pattern);
+ if (list == NULL)
+ list = filelist_new(NULL);
+ }
return list;
}
mode[options.search_mode].table,
pattern);
+ if (browser.filelist == NULL)
+ browser.filelist = filelist_new(NULL);
+
sync_highlights(c, browser.filelist);
mpdclient_install_playlist_callback(c, playlist_changed_callback);
list_window_check_selected(browser.lw, filelist_length(browser.filelist));