From 4d41b0bb00925db7549c8398fce559ba0e769931 Mon Sep 17 00:00:00 2001 From: Andy Hertzfeld Date: Wed, 24 Jan 2001 02:34:50 +0000 Subject: fixed bug 5908, assert hit when background pattern is deleted, by testing * libnautilus-extensions/nautilus-directory-background.c: (theme_image_path_to_uri): fixed bug 5908, assert hit when background pattern is deleted, by testing explicitly for the file missing and returning NULL in that case instead of asserting. --- libnautilus-private/nautilus-directory-background.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libnautilus-private/nautilus-directory-background.c') diff --git a/libnautilus-private/nautilus-directory-background.c b/libnautilus-private/nautilus-directory-background.c index 3ba12aa05..6fba69432 100644 --- a/libnautilus-private/nautilus-directory-background.c +++ b/libnautilus-private/nautilus-directory-background.c @@ -153,9 +153,12 @@ theme_image_path_to_uri (char *image_file, const char *theme_name) image_path = g_strdup_printf ("%s/%s", NAUTILUS_DATADIR, image_file); } - g_assert (g_file_exists (image_path)); + if (image_path && g_file_exists (image_path)) { + image_uri = gnome_vfs_get_uri_from_local_path (image_path); + } else { + image_uri = NULL; + } - image_uri = gnome_vfs_get_uri_from_local_path (image_path); g_free (image_path); } else { image_uri = g_strdup (image_file); -- cgit v1.2.1