[totem] im-status: Return if the dbus callback has been cancelled



commit be2d017263299b6fbe6f3a4cdf9761330755bc3c
Author: crvi <crvisqr gmail com>
Date:   Tue Feb 23 20:18:24 2021 +0530

    im-status: Return if the dbus callback has been cancelled

 src/plugins/im-status/totem-im-status.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/src/plugins/im-status/totem-im-status.c b/src/plugins/im-status/totem-im-status.c
index 16d164ee7..f5f5dd359 100644
--- a/src/plugins/im-status/totem-im-status.c
+++ b/src/plugins/im-status/totem-im-status.c
@@ -120,17 +120,19 @@ got_proxy_cb (GObject             *source_object,
 {
        GError *error = NULL;
        TotemObject *totem;
+       GDBusProxy *proxy;
 
-       pi->priv->proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+       proxy = g_dbus_proxy_new_for_bus_finish (res, &error);
+       if (!proxy) {
+               g_debug ("Could not connect to SessionManager: %s", error->message);
+               g_error_free (error);
+               return;
+       }
 
+       pi->priv->proxy = proxy;
        g_object_unref (pi->priv->cancellable);
        pi->priv->cancellable = NULL;
 
-       if (pi->priv->proxy == NULL) {
-               g_warning ("Failed to contact session manager: %s", error->message);
-               g_error_free (error);
-               return;
-       }
        g_object_get (pi, "object", &totem, NULL);
        totem_im_status_update_from_state (totem, pi);
        g_object_unref (totem);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]