Code

configure.ac: add more optimization flags
[ncmpc.git] / src / screen_client.c
index 90364c0af0df2506daba2839a171beb385de7482..b8e936fdbc0fe6147edd4bbd961f2c590551368d 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
@@ -19,7 +19,7 @@
 
 #include "screen_client.h"
 #include "screen_utils.h"
-#include "screen_message.h"
+#include "screen_status.h"
 #include "mpdclient.h"
 #include "i18n.h"
 #include "charset.h"
@@ -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) {