Code

screen_browser: check for error before adding song to playlist
[ncmpc.git] / src / screen_browser.c
index 45e11ebcfb4ca679345152cb445822606848c3db..04673f4e85a7e5632525a3cf19820fcab1d80ad6 100644 (file)
@@ -143,6 +143,9 @@ static bool
 enqueue_and_play(struct mpdclient *c, struct filelist_entry *entry)
 {
        struct mpd_connection *connection = mpdclient_get_connection(c);
+       if (connection == NULL)
+               return false;
+
        const struct mpd_song *song = mpd_entity_get_song(entry->entity);
        int id;