[epiphany/mcatanzaro/app-mode-fixes] web-app-utils: crash better when EphyWebApplication creation fails
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/app-mode-fixes] web-app-utils: crash better when EphyWebApplication creation fails
- Date: Thu, 26 Mar 2020 20:30:53 +0000 (UTC)
commit 7b0c615991a1b1c8508159da3f38086d6e974867
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 10b30ae20..52f5da7b3 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)
- 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);
@@ -556,11 +556,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]