From 33688c3aece916519259f177b3fa0d2af76ca725 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Wed, 21 Mar 2001 08:31:29 +0000 Subject: Fix a stupid g_warning caused by calling EStorageSet functions on a NULL pointer. svn path=/trunk/; revision=8865 --- shell/ChangeLog | 6 ++++++ shell/e-storage-set-view.c | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'shell') diff --git a/shell/ChangeLog b/shell/ChangeLog index 68e3049f8a..3292acfb88 100644 --- a/shell/ChangeLog +++ b/shell/ChangeLog @@ -1,3 +1,9 @@ +2001-03-21 Ettore Perazzoli + + * e-storage-set-view.c (etree_get_save_id): If we have no + associated StorageSet yet, just return "root". [This can happen + when this function is called at construction time.] + 2001-03-21 Ettore Perazzoli * Evolution-ShellComponentDnd.idl: StudlyCapsify struct members to diff --git a/shell/e-storage-set-view.c b/shell/e-storage-set-view.c index 1b31e018f0..5833e64184 100644 --- a/shell/e-storage-set-view.c +++ b/shell/e-storage-set-view.c @@ -1176,16 +1176,18 @@ etree_get_save_id (ETreeModel *etm, ETreePath node, void *model_data) storage_set_view = E_STORAGE_SET_VIEW (model_data); storage_set = storage_set_view->priv->storage_set; - path = (char *) e_tree_memory_node_get_data (E_TREE_MEMORY(etm), node); + if (storage_set != NULL) { + path = (char *) e_tree_memory_node_get_data (E_TREE_MEMORY(etm), node); - folder = e_storage_set_get_folder (storage_set, path); - if (folder != NULL) { - return g_strdup (e_folder_get_name (folder)); - } + folder = e_storage_set_get_folder (storage_set, path); + if (folder != NULL) { + return g_strdup (e_folder_get_name (folder)); + } - storage = e_storage_set_get_storage (storage_set, path + 1); - if (storage != NULL) - return g_strdup (e_storage_get_name (storage)); + storage = e_storage_set_get_storage (storage_set, path + 1); + if (storage != NULL) + return g_strdup (e_storage_get_name (storage)); + } return g_strdup("root"); } -- cgit v1.2.3