diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 31ce629d40..698b7425ea 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -1673,7 +1673,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_enterprise_originate(switch_core_sess getcause = 0; switch_goto_status(SWITCH_STATUS_FALSE, end); } - } else { + } else if (hl) { x_argc = hl->handle_idx; } @@ -3487,7 +3487,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } } } else { - if (switch_buffer_inuse(early_state.buffer) >= write_frame.codec->implementation->decoded_bytes_per_packet) { + if (write_frame.codec && switch_buffer_inuse(early_state.buffer) >= write_frame.codec->implementation->decoded_bytes_per_packet) { write_frame.datalen = (uint32_t)switch_buffer_read(early_state.buffer, write_frame.data, write_frame.codec->implementation->decoded_bytes_per_packet); }