[telepathy-mission-control/master] mcd_dispatch_operation_constructor: explain why dbus_connection might be NULL

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Oct 20 06:02:47 PDT 2009


---
 src/mcd-dispatch-operation.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/mcd-dispatch-operation.c b/src/mcd-dispatch-operation.c
index 3d98fcd..d9e11fd 100644
--- a/src/mcd-dispatch-operation.c
+++ b/src/mcd-dispatch-operation.c
@@ -558,9 +558,13 @@ mcd_dispatch_operation_constructor (GType type, guint n_params,
         g_object_get (priv->client_registry,
                       "dbus-daemon", &dbus_daemon,
                       NULL);
+
+        /* can be NULL if we have fallen off the bus (in the real MC libdbus
+         * would exit in this situation, but in the debug build, we stay
+         * active briefly) */
         dbus_connection = tp_proxy_get_dbus_connection (dbus_daemon);
 
-        if (G_LIKELY (dbus_connection))
+        if (G_LIKELY (dbus_connection != NULL))
             dbus_g_connection_register_g_object (dbus_connection,
                                                  priv->object_path, object);
 
-- 
1.5.6.5



More information about the telepathy-commits mailing list