From: Max Kellermann Date: Sun, 13 Sep 2009 09:56:42 +0000 (+0200) Subject: screen_browser: added filelist==NULL checks X-Git-Tag: release-0.15~12 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=4a8a5bcf5962897b34fb717f27dffe6eedddd9cf;p=ncmpc.git screen_browser: added filelist==NULL checks If ncmpc could not get a list of files, browser->filelist may be NULL. This patch adds two missing checks. --- diff --git a/src/screen_browser.c b/src/screen_browser.c index 6f29bd7..5f6e048 100644 --- 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); @@ -430,6 +430,9 @@ browser_cmd(struct screen_browser *browser, { struct mpd_song *song; + if (browser->filelist == NULL) + return false; + switch (cmd) { case CMD_PLAY: browser_handle_enter(browser, c);