Code

main.c: fix compiler warning
[ncmpc.git] / src / screen_client.c
index 90364c0af0df2506daba2839a171beb385de7482..f864f1998498e810ea182feddbf3183344220f14 100644 (file)
@@ -1,5 +1,5 @@
 /* ncmpc (Ncurses MPD Client)
- * (c) 2004-2009 The Music Player Daemon Project
+ * (c) 2004-2010 The Music Player Daemon Project
  * Project homepage: http://musicpd.org
  *
  * This program is free software; you can redistribute it and/or modify
@@ -31,6 +31,8 @@ _screen_auth(struct mpdclient *c, gint recursion)
        char *password;
 
        connection = mpdclient_get_connection(c);
+       if (connection == NULL)
+               return false;
 
        mpd_connection_clear_error(connection);
        if (recursion > 2)
@@ -80,6 +82,8 @@ screen_database_update(struct mpdclient *c, const char *path)
        assert(mpdclient_is_connected(c));
 
        connection = mpdclient_get_connection(c);
+       if (connection == NULL)
+               return;
 
        id = mpd_run_update(connection, path);
        if (id == 0) {