From: Timo Sirainen Date: Mon, 22 Sep 2008 19:31:13 +0000 (+0300) Subject: Shared namespace: If we don't have a directory, return NULL instead of panicing. X-Git-Tag: 1.2.alpha2~37 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2b62f4a62b0d99e3d7b256301cc0e059f101913f;p=thirdparty%2Fdovecot%2Fcore.git Shared namespace: If we don't have a directory, return NULL instead of panicing. 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 --- diff --git a/src/lib-storage/index/shared/shared-list.c b/src/lib-storage/index/shared/shared-list.c index b918ec9a40..2c6871af33 100644 --- a/src/lib-storage/index/shared/shared-list.c +++ b/src/lib-storage/index/shared/shared-list.c @@ -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); }