* origin/merge-requests/5:
Fix crash when loading collection listing inexistent files.
This is now a combination of Leons patch
900e65e and merge request of
Laurent. Hopefully that is now a bit more stable.
struct stat st;
gboolean valid;
+ if (!fd) return FALSE;
+
+ g_assert(fd->magick == FD_MAGICK);
+
if (must_exist)
{
valid = (stat_utf8(fd->path, &st) && !S_ISDIR(st.st_mode));
fd = g_hash_table_lookup(file_data_pool, path_utf8);
if (!fd) fd = file_data_new(path_utf8, &st, TRUE);
- file_data_ref(fd);
+ if (fd)
+ {
+ file_data_ref(fd);
+ }
filelist_free(files);
g_free(dir);