From c884f5a0148fa2202108cf53645656db5f0e4636 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Fri, 8 Sep 2000 21:17:34 +0000 Subject: 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 --- shell/ChangeLog | 5 +++++ shell/e-folder-tree.c | 3 +++ 2 files changed, 8 insertions(+) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index ba2f14e9d4..a31eba7d8e 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,8 @@ +2000-09-08 Ettore Perazzoli + + * 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 * evolution-storage.c: New member `folder_tree' in 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; } -- cgit v1.2.3