From 09edad5996bd049e8483d4d6aa7194e2c44deb2d Mon Sep 17 00:00:00 2001 From: kleifgch <81602214+kleifgch@users.noreply.github.com> Date: Sun, 29 Dec 2024 18:34:54 +0100 Subject: [PATCH] main: Do not export Settings without implementations If no settings portal implementations are found, the `settings_create()` function currently returns NULL and the `No skeleton to export` warning. This change guards against that, which is more consistent with the other portals. --- src/xdg-desktop-portal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/xdg-desktop-portal.c b/src/xdg-desktop-portal.c index 396ee2438..fc84030d1 100644 --- a/src/xdg-desktop-portal.c +++ b/src/xdg-desktop-portal.c @@ -253,7 +253,8 @@ on_bus_acquired (GDBusConnection *connection, export_portal_implementation (connection, realtime_create (connection)); impls = find_all_portal_implementations ("org.freedesktop.impl.portal.Settings"); - export_portal_implementation (connection, settings_create (connection, impls)); + if (impls->len > 0) + export_portal_implementation (connection, settings_create (connection, impls)); g_ptr_array_free (impls, TRUE); implementation = find_portal_implementation ("org.freedesktop.impl.portal.FileChooser");