1
0
xdg-desktop-portal/0003-Fix-criticals-if-no-default-handler-for-desired-type.patch

36 lines
1.1 KiB
Diff
Raw Normal View History

From f8a261b0a56d7eacab79a9086611ba4208fe3842 Mon Sep 17 00:00:00 2001
From: Simon McVittie <smcv@debian.org>
Date: Sun, 22 Dec 2019 15:54:33 +0000
Subject: [PATCH] open-uri: Fix criticals if no default handler for desired
type
Signed-off-by: Simon McVittie <smcv@debian.org>
---
src/open-uri.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/open-uri.c b/src/open-uri.c
index c876ab6..f032894 100644
--- a/src/open-uri.c
+++ b/src/open-uri.c
@@ -473,9 +473,17 @@ find_recommended_choices (const char *scheme,
int i;
info = g_app_info_get_default_for_type (content_type, FALSE);
- *default_app = get_app_id (info);
- g_debug ("Default handler %s for %s, %s", *default_app, scheme, content_type);
+ if (info != NULL)
+ {
+ *default_app = get_app_id (info);
+ g_debug ("Default handler %s for %s, %s", *default_app, scheme, content_type);
+ }
+ else
+ {
+ *default_app = NULL;
+ g_debug ("No default handler for %s, %s", scheme, content_type);
+ }
infos = g_app_info_get_recommended_for_type (content_type);
/* Use fallbacks if we have no recommended application for this type */