]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Shared namespace: If we don't have a directory, return NULL instead of panicing.
authorTimo Sirainen <tss@iki.fi>
Mon, 22 Sep 2008 19:31:13 +0000 (22:31 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 22 Sep 2008 19:31:13 +0000 (22:31 +0300)
The callers are now expected to handle returned NULLs. In future some other
non-filesystem based storages will probably also return NULLs.

--HG--
branch : HEAD

src/lib-storage/index/shared/shared-list.c

index b918ec9a40a37f82f6e282e5769e62379dbfb2c0..2c6871af33604eba086556ebfc549e6800ac9c3e 100644 (file)
@@ -73,7 +73,7 @@ shared_list_get_path(struct mailbox_list *list, const char *name,
 {
        struct mail_namespace *ns;
 
-       if (list->ns->storage == NULL ||
+       if (list->ns->storage == NULL || name == NULL ||
            shared_storage_get_namespace(list->ns->storage, &name, &ns) < 0) {
                switch (type) {
                case MAILBOX_LIST_PATH_TYPE_DIR:
@@ -84,8 +84,8 @@ shared_list_get_path(struct mailbox_list *list, const char *name,
                        /* we can safely say we don't use indexes */
                        return "";
                }
-               i_panic("shared mailbox list: Can't return path for '%s'",
-                       list->ns->prefix);
+               /* we don't have a directory we can use. */
+               return NULL;
        }
        return mailbox_list_get_path(ns->list, name, type);
 }