aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEttore Perazzoli <ettore@src.gnome.org>2000-09-09 05:17:34 +0800
committerEttore Perazzoli <ettore@src.gnome.org>2000-09-09 05:17:34 +0800
commitc884f5a0148fa2202108cf53645656db5f0e4636 (patch)
tree8ed84f007450e5308756a2f2ee29757ff4b6ab15
parentdb75f8912dff0be20f17946b0131e88ae67ea837 (diff)
downloadgsoc2013-evolution-c884f5a0148fa2202108cf53645656db5f0e4636.tar
gsoc2013-evolution-c884f5a0148fa2202108cf53645656db5f0e4636.tar.gz
gsoc2013-evolution-c884f5a0148fa2202108cf53645656db5f0e4636.tar.bz2
gsoc2013-evolution-c884f5a0148fa2202108cf53645656db5f0e4636.tar.lz
gsoc2013-evolution-c884f5a0148fa2202108cf53645656db5f0e4636.tar.xz
gsoc2013-evolution-c884f5a0148fa2202108cf53645656db5f0e4636.tar.zst
gsoc2013-evolution-c884f5a0148fa2202108cf53645656db5f0e4636.zip
Fix `e_folder_tree_get_folder()' so that it returns NULL (instead of
segfaulting) if there is no folder at the specified @path. svn path=/trunk/; revision=5276
-rw-r--r--shell/ChangeLog5
-rw-r--r--shell/e-folder-tree.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index ba2f14e9d4..a31eba7d8e 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,5 +1,10 @@
2000-09-08 Ettore Perazzoli <ettore@helixcode.com>
+ * e-folder-tree.c (e_folder_tree_get_folder): Return NULL if there
+ is no folder with that @path, instead of segfaulting.
+
+2000-09-08 Ettore Perazzoli <ettore@helixcode.com>
+
* evolution-storage.c: New member `folder_tree' in
`EvolutionStoragePrivate'.
(init): Initialize it.
diff --git a/shell/e-folder-tree.c b/shell/e-folder-tree.c
index 38a7206051..0c719ca9a4 100644
--- a/shell/e-folder-tree.c
+++ b/shell/e-folder-tree.c
@@ -306,6 +306,9 @@ e_folder_tree_get_folder (EFolderTree *folder_tree,
g_return_val_if_fail (g_path_is_absolute (path), NULL);
folder = g_hash_table_lookup (folder_tree->path_to_folder, path);
+ if (folder == NULL)
+ return NULL;
+
return folder->data;
}