aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/app_voicemail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/app_voicemail.c b/apps/app_voicemail.c
index 2b20bd287..4c41ce445 100644
--- a/apps/app_voicemail.c
+++ b/apps/app_voicemail.c
@@ -4421,7 +4421,7 @@ static int play_message(struct ast_channel *chan, struct ast_vm_user *vmu, struc
mail_fetchstructure (vms->mailstream,vms->msgArray[vms->curmsg],&body);
/* We have the body, now we extract the file name of the first attachment. */
- if (body->nested.part->next && body->nested.part->next->body.parameter->value) {
+ if (body->nested.part && body->nested.part->next && body->nested.part->next->body.parameter->value) {
attachedfilefmt = ast_strdupa(body->nested.part->next->body.parameter->value);
} else {
ast_log(LOG_ERROR, "There is no file attached to this IMAP message.\n");