Fix segfault on answer.
[asterisk/asterisk.git] / channels / chan_skinny.c
index f65d377..896f38e 100644 (file)
@@ -4812,10 +4812,14 @@ static int skinny_indicate(struct ast_channel *ast, int ind, const void *data, s
        case AST_CONTROL_PROCEEDING:
                break;
        case AST_CONTROL_SRCUPDATE:
-               ast_rtp_instance_update_source(sub->rtp);
+               if (sub->rtp) {
+                       ast_rtp_instance_update_source(sub->rtp);
+               }
                break;
        case AST_CONTROL_SRCCHANGE:
-               ast_rtp_instance_change_source(sub->rtp);
+               if (sub->rtp) {
+                       ast_rtp_instance_change_source(sub->rtp);
+               }
                break;
        case AST_CONTROL_CONNECTED_LINE:
                update_connectedline(sub, data, datalen);