From ef123b6c2e907cf660d4ba69451156aad2353019 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Fri, 7 Dec 2018 20:16:02 -0500 Subject: [PATCH] FS-11532: fix crash (87d4a6a0) --- src/switch_ivr_async.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c index d80426f347..23d669214f 100644 --- a/src/switch_ivr_async.c +++ b/src/switch_ivr_async.c @@ -1321,11 +1321,12 @@ static switch_bool_t record_callback(switch_media_bug_t *bug, void *user_data, s rh->completion_cause = NULL; switch_core_session_get_read_impl(session, &rh->read_impl); - switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Record session sample rate: %d -> %d\n", rh->fh->native_rate, rh->read_impl.actual_samples_per_second); - rh->fh->native_rate = rh->read_impl.actual_samples_per_second; - - if (rh->fh && switch_core_file_has_video(rh->fh, SWITCH_TRUE)) { - switch_core_media_bug_set_media_params(bug, &rh->fh->mm); + if (rh->fh) { + switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Record session sample rate: %d -> %d\n", rh->fh->native_rate, rh->read_impl.actual_samples_per_second); + rh->fh->native_rate = rh->read_impl.actual_samples_per_second; + if (switch_core_file_has_video(rh->fh, SWITCH_TRUE)) { + switch_core_media_bug_set_media_params(bug, &rh->fh->mm); + } } }