aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog6
-rw-r--r--shell/e-shell-view.c8
2 files changed, 13 insertions, 1 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 170a92e22f..c401b553b6 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,9 @@
+2000-12-11 Dan Winship <danw@helixcode.com>
+
+ * e-shell-view.c (get_type_for_{folder,storage}): return NULL if
+ no {folder,storage} is found.
+ (get_control_for_uri): return NULL if no folder_type is found.
+
2000-12-08 Ettore Perazzoli <ettore@helixcode.com>
* e-shortcuts-view.c (e_shortcuts_view_construct): Ooops. We were
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 38507668ce..2e14e2966c 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -1251,6 +1251,8 @@ get_type_for_storage (EShellView *shell_view,
storage_set = e_shell_get_storage_set (priv->shell);
storage = e_storage_set_get_storage (storage_set, name);
+ if (!storage)
+ return NULL;
*physical_uri_return = e_storage_get_toplevel_node_uri (storage);
@@ -1271,6 +1273,8 @@ get_type_for_folder (EShellView *shell_view,
storage_set = e_shell_get_storage_set (priv->shell);
folder = e_storage_set_get_folder (storage_set, path);
+ if (!folder)
+ return NULL;
*physical_uri_return = e_folder_get_physical_uri (folder);
@@ -1311,11 +1315,13 @@ get_control_for_uri (EShellView *shell_view,
/* FIXME: This code needs to be made more robust. */
- slash = strchr (path, G_DIR_SEPARATOR);
+ slash = strchr (path + 1, G_DIR_SEPARATOR);
if (slash == NULL || slash[1] == '\0')
folder_type = get_type_for_storage (shell_view, path, &physical_uri);
else
folder_type = get_type_for_folder (shell_view, path, &physical_uri);
+ if (!folder_type)
+ return NULL;
folder_type_registry = e_shell_get_folder_type_registry (e_shell_view_get_shell (shell_view));