]> Pileus Git - grits/blobdiff - src/data/grits-http.c
Fix warning if with non-existent cache paths
[grits] / src / data / grits-http.c
index 19b751f32141e80f564cd369da3d69a6814e9aac..76e68a4aa2935dd79b039ffe67f027cf0b7b9756 100644 (file)
@@ -249,7 +249,7 @@ GList *grits_http_available(GritsHttp *http,
                const gchar *file;
                gchar *path = _get_cache_path(http, cache);
                GDir  *dir  = g_dir_open(path, 0, NULL);
-               while ((file = g_dir_read_name(dir)))
+               while (dir && (file = g_dir_read_name(dir)))
                        if (g_regex_match(filter_re, file, 0, NULL))
                                files = g_list_prepend(files, g_strdup(file));
                g_free(path);