[glib/glib-2-72: 37/39] GDesktopAppInfo: Ignore flushing the session bus when there's not




commit d1766e99e5e15649902a662e858fa521e9bdca22
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.
    
    (cherry-picked from commit eee15225c74559f1ba02c78175a25be186cf1cf7)

 gio/gdesktopappinfo.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gio/gdesktopappinfo.c b/gio/gdesktopappinfo.c
index 7d9c3daf1c..994846e6c4 100644
--- a/gio/gdesktopappinfo.c
+++ b/gio/gdesktopappinfo.c
@@ -3354,11 +3354,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]