Merged revisions 48101 via svnmerge from
[asterisk/asterisk.git] / apps / app_voicemail.c
index 57eed5f..8e27d90 100644 (file)
@@ -4673,7 +4673,7 @@ static int open_mailbox(struct vm_state *vms, struct ast_vm_user *vmu, int box)
        if(option_debug > 2)
                ast_log(LOG_DEBUG,"Before init_mailstream, user is %s\n",vmu->imapuser);
        ret = init_mailstream(vms, box);
-       if (ret != 0) {
+       if (ret != 0 || !vms->mailstream) {
                ast_log (LOG_ERROR,"Could not initialize mailstream\n");
                return -1;
        }