Commit 22c8372d authored by Vincent Untz's avatar Vincent Untz Committed by Vincent Untz

handle NULL errors instead of crashing, which can happen in some cases in

2009-03-24  Vincent Untz  <vuntz@gnome.org>

	* gnome-session/gsm-inhibit-dialog.c: (add_inhibitor): handle NULL
	errors instead of crashing, which can happen in some cases in
	EggDesktopFile.

svn path=/trunk/; revision=5348
parent 3221430d
2009-03-24 Vincent Untz <vuntz@gnome.org>
* gnome-session/gsm-inhibit-dialog.c: (add_inhibitor): handle NULL
errors instead of crashing, which can happen in some cases in
EggDesktopFile.
2009-03-24 Vincent Untz <vuntz@gnome.org>
* gnome-session/gsm-inhibit-dialog.c: use a 32x32 icon size for icons,
......
......@@ -531,8 +531,14 @@ add_inhibitor (GsmInhibitDialog *dialog,
/* look for a file with a vendor prefix */
if (desktop_file == NULL) {
g_warning ("Unable to find desktop file '%s': %s", desktop_filename, error->message);
g_error_free (error);
if (error) {
g_warning ("Unable to find desktop file '%s': %s",
desktop_filename, error->message);
g_error_free (error);
} else {
g_warning ("Unable to find desktop file '%s'",
desktop_filename);
}
g_free (desktop_filename);
desktop_filename = g_strdup_printf ("gnome-%s.desktop", app_id);
error = NULL;
......@@ -543,8 +549,14 @@ add_inhibitor (GsmInhibitDialog *dialog,
g_strfreev (search_dirs);
if (desktop_file == NULL) {
g_warning ("Unable to find desktop file '%s': %s", desktop_filename, error->message);
g_error_free (error);
if (error) {
g_warning ("Unable to find desktop file '%s': %s",
desktop_filename, error->message);
g_error_free (error);
} else {
g_warning ("Unable to find desktop file '%s'",
desktop_filename);
}
} else {
name = egg_desktop_file_get_name (desktop_file);
icon_name = egg_desktop_file_get_icon (desktop_file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment