From 2ca0db49f3d75fe732885cbad2ba89c4c71beb93 Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Tue, 25 Aug 2009 15:59:07 -0500 Subject: Handling a missing session bus by displaying an error. --- src/status-provider-telepathy.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/status-provider-telepathy.c') diff --git a/src/status-provider-telepathy.c b/src/status-provider-telepathy.c index bed962f..e22c27d 100644 --- a/src/status-provider-telepathy.c +++ b/src/status-provider-telepathy.c @@ -112,6 +112,11 @@ status_provider_telepathy_init (StatusProviderTelepathy *self) GError * error = NULL; DBusGConnection * session_bus = dbus_g_bus_get(DBUS_BUS_SESSION, &error); + if (session_bus == NULL) { + g_warning("Unable to connect to Session Bus: %s", error == NULL ? "No message" : error->message); + g_error_free(error); + return; + } priv->proxy = NULL; priv->proxy = dbus_g_proxy_new_for_name_owner(session_bus, -- cgit v1.2.3