[epiphany/gnome-3-36] web-app-utils: crash better when EphyWebApplication creation fails



commit ce6034a3b09d39ce39c1c54ea8492520a1d72341
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Thu Mar 26 14:43:37 2020 -0500

    web-app-utils: crash better when EphyWebApplication creation fails
    
    This is always going to be fatal, but it's better to crash in a
    controlled way.

 lib/ephy-web-app-utils.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 92bb16432..b8c3ec956 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -546,7 +546,7 @@ ephy_web_application_for_profile_directory (const char *profile_dir)
 
   id = get_app_id_from_profile_directory (profile_dir);
   if (!id)
-    return NULL;
+    g_error ("Cannot create EphyWebApplication: failed to get app ID from profile directory %s", 
profile_dir);
 
   app = g_new0 (EphyWebApplication, 1);
   app->id = g_strdup (id);
@@ -554,11 +554,8 @@ ephy_web_application_for_profile_directory (const char *profile_dir)
   app->desktop_file = get_app_desktop_filename (id);
   desktop_file_path = g_build_filename (profile_dir, app->desktop_file, NULL);
   desktop_info = g_desktop_app_info_new_from_filename (desktop_file_path);
-  if (!desktop_info) {
-    ephy_web_application_free (app);
-    g_free (desktop_file_path);
-    return NULL;
-  }
+  if (!desktop_info)
+    g_error ("Cannot create EphyWebApplication: failed to create GDesktopAppInfo from desktop file %s", 
desktop_file_path);
 
   app->name = g_strdup (g_app_info_get_name (G_APP_INFO (desktop_info)));
   app->icon_url = g_desktop_app_info_get_string (desktop_info, "Icon");


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