[glib: 19/24] GDesktopAppInfo: Ignore flushing the session bus when there's not




commit eee15225c74559f1ba02c78175a25be186cf1cf7
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Tue Jun 14 23:10:16 2022 +0200

    GDesktopAppInfo: Ignore flushing the session bus when there's not
    
    In some cases (such as in our CI tests) we may not have any dbus session
    set after launching, but we always assumed so.
    
    In case we have not a session bus set, we only have to return early.

 gio/gdesktopappinfo.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 8845d6b660..c0950ae759 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -3349,11 +3349,16 @@ launch_uris_bus_get_cb (GObject      *object,
           g_task_return_error (task, g_steal_pointer (&error));
           g_object_unref (task);
         }
-      else
+      else if (session_bus)
         g_dbus_connection_flush (session_bus,
                                  cancellable,
                                  launch_uris_flush_cb,
                                  g_steal_pointer (&task));
+      else
+        {
+          g_task_return_boolean (task, TRUE);
+          g_clear_object (&task);
+        }
     }
 
   g_clear_object (&session_bus);


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