Fix checking for CONFIG_STATUS_FILEINVALID so that modules don't crash upon trying...
[asterisk/asterisk.git] / cdr / cdr_radius.c
index d326eba..2251f14 100644 (file)
@@ -228,7 +228,7 @@ static int load_module(void)
        int res;
        const char *tmp;
 
-       if ((cfg = ast_config_load(cdr_config, config_flags))) {
+       if ((cfg = ast_config_load(cdr_config, config_flags)) && cfg != CONFIG_STATUS_FILEINVALID) {
                ast_set2_flag(&global_flags, ast_true(ast_variable_retrieve(cfg, "radius", "usegmtime")), RADIUS_FLAG_USEGMTIME);
                ast_set2_flag(&global_flags, ast_true(ast_variable_retrieve(cfg, "radius", "loguniqueid")), RADIUS_FLAG_LOGUNIQUEID);
                ast_set2_flag(&global_flags, ast_true(ast_variable_retrieve(cfg, "radius", "loguserfield")), RADIUS_FLAG_LOGUSERFIELD);