Fix seg in chan_agent (bug #5402)
authorMark Spencer <markster@digium.com>
Thu, 13 Oct 2005 16:29:49 +0000 (16:29 +0000)
committerMark Spencer <markster@digium.com>
Thu, 13 Oct 2005 16:29:49 +0000 (16:29 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6757 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_agent.c

index e574a1f..1f5a34c 100755 (executable)
@@ -490,7 +490,7 @@ static struct ast_frame *agent_read(struct ast_channel *ast)
        } else {
                /* if acknowledgement is not required, and the channel is up, we may have missed
                   an AST_CONTROL_ANSWER (if there was one), so mark the call acknowledged anyway */
-               if (!p->ackcall && !p->acknowledged && p->chan->_state == AST_STATE_UP)
+               if (!p->ackcall && !p->acknowledged && p->chan && (p->chan->_state == AST_STATE_UP))
                        p->acknowledged = 1;
                switch (f->frametype) {
                case AST_FRAME_CONTROL: