summaryrefslogtreecommitdiff
path: root/libnautilus-extensions/nautilus-theme.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnautilus-extensions/nautilus-theme.c')
-rw-r--r--libnautilus-extensions/nautilus-theme.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/libnautilus-extensions/nautilus-theme.c b/libnautilus-extensions/nautilus-theme.c
index 2857a7c8e..9e6af656e 100644
--- a/libnautilus-extensions/nautilus-theme.c
+++ b/libnautilus-extensions/nautilus-theme.c
@@ -182,17 +182,21 @@ nautilus_theme_make_selector (const char *theme_name)
pixbuf_file = nautilus_pixmap_file(temp_str);
g_free (temp_str);
- if (!g_file_exists (pixbuf_file)) {
- g_free (pixbuf_file);
+ if (pixbuf_file == NULL) {
temp_str = g_strdup_printf ("%s/%s", theme_name, "i-directory.svg");
pixbuf_file = nautilus_pixmap_file(temp_str);
g_free (temp_str);
- if (!g_file_exists (pixbuf_file)) {
- g_free (pixbuf_file);
+ if (pixbuf_file == NULL) {
pixbuf_file = nautilus_pixmap_file ("i-directory.png");
}
}
+ /* if we can't find anything, return NULL */
+ if (pixbuf_file == NULL) {
+ return NULL;
+ }
+
+ /* load the icon that we found and return it */
if (nautilus_str_has_suffix(pixbuf_file, ".svg")) {
FILE *f = fopen (pixbuf_file, "rb");
if (f != NULL) {