Code

mpdclient: handle mpd_send_add's return value
[ncmpc.git] / src / mpdclient.c
index 24ac897527270cfc41cd425d3ef76e3919f49004..637aef76b8d0ffea6d8d4682c632eba3e67be154 100644 (file)
@@ -412,8 +412,8 @@ mpdclient_cmd_add_path(struct mpdclient *c, const gchar *path_utf8)
        if (connection == NULL)
                return false;
 
-       mpd_send_add(connection, path_utf8);
-       return mpdclient_finish_command(c);
+       return mpd_send_add(connection, path_utf8)?
+               mpdclient_finish_command(c) : false;
 }
 
 bool