[epiphany/mcatanzaro/webapp-crashes: 14/15] Revert "web-app-utils: crash better when EphyWebApplication creation fails"



commit d872ab6cd413d009eb5d7b764dbad99a75ff5302
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Apr 29 17:21:03 2020 -0500

    Revert "web-app-utils: crash better when EphyWebApplication creation fails"
    
    This reverts commit ce6034a3b09d39ce39c1c54ea8492520a1d72341.
    
    This is causing crashes when loading about:applications if
    ~/.local/share/applications contains broken symlinks.

 lib/ephy-web-app-utils.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index 52f5da7b3..10b30ae20 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -548,7 +548,7 @@ ephy_web_application_for_profile_directory (const char *profile_dir)
 
   id = get_app_id_from_profile_directory (profile_dir);
   if (!id)
-    g_error ("Cannot create EphyWebApplication: failed to get app ID from profile directory %s", 
profile_dir);
+    return NULL;
 
   app = g_new0 (EphyWebApplication, 1);
   app->id = g_strdup (id);
@@ -556,8 +556,11 @@ 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)
-    g_error ("Cannot create EphyWebApplication: failed to create GDesktopAppInfo from desktop file %s", 
desktop_file_path);
+  if (!desktop_info) {
+    ephy_web_application_free (app);
+    g_free (desktop_file_path);
+    return NULL;
+  }
 
   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]