summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: eb97953)
raw | patch | inline | side by side (parent: eb97953)
author | Max Kellermann <max@duempel.org> | |
Sun, 13 Sep 2009 09:56:42 +0000 (11:56 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 13 Sep 2009 09:56:42 +0000 (11:56 +0200) |
If ncmpc could not get a list of files, browser->filelist may be
NULL. This patch adds two missing checks.
NULL. This patch adds two missing checks.
src/screen_browser.c | patch | blob | history |
diff --git a/src/screen_browser.c b/src/screen_browser.c
index 6f29bd70ae04567b776d8f23834c54faf2308c07..5f6e048810ab00a8a6b97efe72b4bb8961bdc7fa 100644 (file)
--- a/src/screen_browser.c
+++ b/src/screen_browser.c
@@ -124,7 +124,7 @@ browser_lw_callback(unsigned idx, bool *highlight, G_GNUC_UNUSED char **second_c
filelist_entry_t *entry;
mpd_InfoEntity *entity;
- if (idx >= filelist_length(fl))
+ if (fl == NULL || idx >= filelist_length(fl))
return NULL;
entry = filelist_get(fl, idx);
{
struct mpd_song *song;
+ if (browser->filelist == NULL)
+ return false;
+
switch (cmd) {
case CMD_PLAY:
browser_handle_enter(browser, c);