diff options
author | Dmitry Isaikin <isaikin-dmitry@yandex.ru> | 2016-04-27 17:26:03 +0300 |
---|---|---|
committer | HoĆ V. DINH <dinh.viet.hoa@gmail.com> | 2016-04-27 07:26:03 -0700 |
commit | ead6600cb6a4f8bee0f28e193466e0da5a20abaf (patch) | |
tree | 21d01756046f4b2eabe71608526a3d42da30cf6d | |
parent | 23305f3df8bf4951476c5cd7b143fdd910cdbb08 (diff) |
Do not segfault on MailProvider::*FolderPath in case of absence information about folders in providers.json (#1410)
-rw-r--r-- | src/core/provider/MCMailProvider.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/provider/MCMailProvider.cpp b/src/core/provider/MCMailProvider.cpp index 99fc4deb..ad186042 100644 --- a/src/core/provider/MCMailProvider.cpp +++ b/src/core/provider/MCMailProvider.cpp @@ -249,36 +249,50 @@ bool MailProvider::matchDomain(String * match, String * domain) String * MailProvider::sentMailFolderPath() { + if (mMailboxPaths == NULL) + return NULL; return (String *) mMailboxPaths->objectForKey(MCSTR("sentmail")); } String * MailProvider::starredFolderPath() { + if (mMailboxPaths == NULL) + return NULL; return (String *) mMailboxPaths->objectForKey(MCSTR("starred")); } String * MailProvider::allMailFolderPath() { + if (mMailboxPaths == NULL) + return NULL; return (String *) mMailboxPaths->objectForKey(MCSTR("allmail")); } String * MailProvider::trashFolderPath() { + if (mMailboxPaths == NULL) + return NULL; return (String *) mMailboxPaths->objectForKey(MCSTR("trash")); } String * MailProvider::draftsFolderPath() { + if (mMailboxPaths == NULL) + return NULL; return (String *) mMailboxPaths->objectForKey(MCSTR("drafts")); } String * MailProvider::spamFolderPath() { + if (mMailboxPaths == NULL) + return NULL; return (String *) mMailboxPaths->objectForKey(MCSTR("spam")); } String * MailProvider::importantFolderPath() { + if (mMailboxPaths == NULL) + return NULL; return (String *) mMailboxPaths->objectForKey(MCSTR("important")); } |