From c8c2cd502377dada79364b76ac7a2d17192576f5 Mon Sep 17 00:00:00 2001 From: Diego Gonzalez Date: Mon, 12 Jan 2004 19:32:43 +0000 Subject: [PATCH] don't crash if we could not get the file information. 2004-01-12 Diego Gonzalez * gnome-wp-xml.c (gnome_wp_load_legacy): don't crash if we could not get the file information. --- capplets/background/ChangeLog | 5 +++++ capplets/background/gnome-wp-xml.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/capplets/background/ChangeLog b/capplets/background/ChangeLog index 36ba88a4a..ab5898630 100644 --- a/capplets/background/ChangeLog +++ b/capplets/background/ChangeLog @@ -1,3 +1,8 @@ +2004-01-12 Diego Gonzalez + + * gnome-wp-xml.c (gnome_wp_load_legacy): don't crash if we could + not get the file information. + 2004-01-12 Jody Goldberg * Makefile.am : As long as we're hard coding the path hard code it in diff --git a/capplets/background/gnome-wp-xml.c b/capplets/background/gnome-wp-xml.c index df8f1a927..44b0fc5e1 100644 --- a/capplets/background/gnome-wp-xml.c +++ b/capplets/background/gnome-wp-xml.c @@ -81,6 +81,10 @@ static void gnome_wp_load_legacy (GnomeWPCapplet * capplet) { item->filename = g_strdup (foo); item->fileinfo = gnome_wp_info_new (item->filename, capplet->thumbs); + if (item->fileinfo == NULL) { + g_free (item); + continue; + } item->shade_type = gconf_client_get_string (capplet->client, WP_SHADING_KEY, NULL);