Skip to content

Commit

Permalink
fix: if config option is undefined then try to get default value
Browse files Browse the repository at this point in the history
  • Loading branch information
en9inerd committed Feb 27, 2024
1 parent 31760ca commit e4a8043
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/services/config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ export class ConfigService {
return defaultValue;
}
throw new ConfigException(`Config key "${key}" not found`);
} else {
if (config[k] === null || config[k] === undefined) {
if (defaultValue !== undefined) {
return defaultValue;
}
}
}
config = config[k];
}
Expand Down

0 comments on commit e4a8043

Please sign in to comment.