projects
/
geeqie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
cf90f24
)
Fix crash when loading collection listing inexistent files.
author
Laurent Monin
<zas@norz.org>
Mon, 26 Nov 2012 08:29:17 +0000
(09:29 +0100)
committer
Laurent Monin
<zas@norz.org>
Thu, 13 Dec 2012 11:40:16 +0000
(12:40 +0100)
src/collect.c
patch
|
blob
|
history
src/filedata.c
patch
|
blob
|
history
diff --git
a/src/collect.c
b/src/collect.c
index
c69155d
..
e3c0157
100644
(file)
--- a/
src/collect.c
+++ b/
src/collect.c
@@
-595,6
+595,10
@@
gboolean collection_add_check(CollectionData *cd, FileData *fd, gboolean sorted,
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));
diff --git
a/src/filedata.c
b/src/filedata.c
index
e0d70f0
..
9478cf8
100644
(file)
--- a/
src/filedata.c
+++ b/
src/filedata.c
@@
-1150,8
+1150,10
@@
FileData *file_data_new_group(const gchar *path_utf8)
filelist_read_real(dir, &files, NULL, TRUE);
fd = g_hash_table_lookup(file_data_pool, path_utf8);
- g_assert(fd);
- file_data_ref(fd);
+ if (fd)
+ {
+ file_data_ref(fd);
+ }
filelist_free(files);
g_free(dir);