aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2000-12-12 06:05:52 +0800
committerDan Winship <danw@src.gnome.org>2000-12-12 06:05:52 +0800
commit23be726b6025c8e1a656840903da15f7d1f3fb37 (patch)
tree2027ca403a30400b4ce058e4b1abf20ace0fee7b
parentca5f6c74720984f996ab53551ec3fb7cf3edc3db (diff)
downloadgsoc2013-evolution-23be726b6025c8e1a656840903da15f7d1f3fb37.tar
gsoc2013-evolution-23be726b6025c8e1a656840903da15f7d1f3fb37.tar.gz
gsoc2013-evolution-23be726b6025c8e1a656840903da15f7d1f3fb37.tar.bz2
gsoc2013-evolution-23be726b6025c8e1a656840903da15f7d1f3fb37.tar.lz
gsoc2013-evolution-23be726b6025c8e1a656840903da15f7d1f3fb37.tar.xz
gsoc2013-evolution-23be726b6025c8e1a656840903da15f7d1f3fb37.tar.zst
gsoc2013-evolution-23be726b6025c8e1a656840903da15f7d1f3fb37.zip
return NULL if no {folder,storage} is found. (get_control_for_uri): return
* 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. svn path=/trunk/; revision=6914
-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));