From 7b293aff4cbfa6f28b906d72605813c40b7b0ed6 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Tue, 6 Jan 2009 16:46:04 +0000 Subject: Don't set random values in EmpathyIdle init if MC is not running. svn path=/trunk/; revision=2026 --- libempathy/empathy-idle.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/libempathy/empathy-idle.c b/libempathy/empathy-idle.c index bc40cc899..d9c8178e8 100644 --- a/libempathy/empathy-idle.c +++ b/libempathy/empathy-idle.c @@ -402,11 +402,16 @@ empathy_idle_init (EmpathyIdle *idle) idle->priv = priv; priv->is_idle = FALSE; priv->mc = empathy_mission_control_new (); - priv->state = mission_control_get_presence_actual (priv->mc, NULL); - priv->status = mission_control_get_presence_message_actual (priv->mc, NULL); - if (G_STR_EMPTY (priv->status)) { + priv->state = mission_control_get_presence_actual (priv->mc, &error); + if (error) { + priv->state = MC_PRESENCE_UNSET; + g_clear_error (&error); + } + priv->status = mission_control_get_presence_message_actual (priv->mc, &error); + if (error) { g_free (priv->status); priv->status = NULL; + g_clear_error (&error); } dbus_g_proxy_connect_signal (DBUS_G_PROXY (priv->mc), -- cgit v1.2.3