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.
This commit is contained in:
Marco Trevisan (Treviño) 2022-06-14 23:10:16 +02:00
parent 6fef60b65c
commit eee15225c7

View File

@ -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);