diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index cb450e62e2..5b9b3931e6 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1517,7 +1517,7 @@ static void sofia_handle_sip_r_options(switch_core_session_t *session, int statu { sofia_gateway_t *gateway = NULL; - if (sofia_private->gateway_name) { + if (sofia_private && !switch_strlen_zero(sofia_private->gateway_name)) { gateway = sofia_reg_find_gateway(sofia_private->gateway_name); }