[epiphany/gnome-3-36] Revert "web-app-utils: crash better when EphyWebApplication creation fails"
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/gnome-3-36] Revert "web-app-utils: crash better when EphyWebApplication creation fails"
- Date: Thu, 30 Apr 2020 17:32:57 +0000 (UTC)
commit 824c5de9df56670faff3d57aebacdd1a9de026fb
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Wed Apr 29 22:21:03 2020 +0000
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.
(cherry picked from commit 141169b7466c7cd1dd90a46cfb8887f596c3ca2a)
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 b8c3ec956..92bb16432 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)
- 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);
@@ -554,8 +554,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]