diff --git a/src/include/switch_loadable_module.h b/src/include/switch_loadable_module.h index 0392583870..f868830efc 100644 --- a/src/include/switch_loadable_module.h +++ b/src/include/switch_loadable_module.h @@ -430,7 +430,7 @@ static inline void switch_core_codec_add_implementation(switch_memory_pool_t *po static inline switch_bool_t switch_core_codec_ready(switch_codec_t *codec) { - return (codec->flags & SWITCH_CODEC_FLAG_READY) ? SWITCH_TRUE : SWITCH_FALSE; + return (codec && codec->implementation && (codec->flags & SWITCH_CODEC_FLAG_READY)) ? SWITCH_TRUE : SWITCH_FALSE; }