[epiphany] Handle errors returned by g_app_info_get_default_for_type ()



commit 0c0147af15456a2f653d5f637122f9a3f537877f
Author: Jan-Michael Brummer <jan brummer tabos org>
Date:   Wed Nov 13 17:14:52 2019 +0100

    Handle errors returned by g_app_info_get_default_for_type ()
    
    Fixes: https://gitlab.gnome.org/GNOME/epiphany/issues/888

 lib/ephy-file-helpers.c | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 4b961a715..c99f25f97 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -684,6 +684,11 @@ open_in_default_handler (const char                   *uri,
   gdk_app_launch_context_set_timestamp (context, timestamp);
 
   appinfo = g_app_info_get_default_for_type (mime_type, TRUE);
+  if (!appinfo) {
+    g_warning ("Failed to get default app for MIME type: %s", mime_type);
+    return FALSE;
+  }
+
   uris.data = (gpointer)uri;
   uris.next = uris.prev = NULL;
 


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