Code

check the return value of mpdclient_get_connection()
[ncmpc.git] / src / screen_browser.c
index 8802e5f93bb1eab29ed8d8ace445048a8fea495f..45b782a079378b5d2c3fbe84cae10e211c727fd2 100644 (file)
@@ -123,6 +123,9 @@ load_playlist(struct mpdclient *c, const struct mpd_playlist *playlist)
 {
        struct mpd_connection *connection = mpdclient_get_connection(c);
 
+       if (connection == NULL)
+               return false;
+
        if (mpd_run_load(connection, mpd_playlist_get_path(playlist))) {
                char *filename = utf8_to_locale(mpd_playlist_get_path(playlist));
                screen_status_printf(_("Loading playlist %s..."),