Verified Commit 645c46ca authored by Merzough Münker's avatar Merzough Münker
Browse files

fix(config.service): improve path handling and property access validation

parent 250614ef
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -298,9 +298,8 @@ export class ConfigService<Config extends Record<string, any> = Record<string, a
    if (typeof path !== 'string') {
      throw new Error('The config property path is not a string');
    }
    for (const fragment of (path as any).split('.')) {
      // eslint-disable-next-line no-prototype-builtins
      if (configValue.hasOwnProperty(fragment)) {
    for (const fragment of path.split('.')) {
      if (configValue && typeof configValue === 'object' && fragment in configValue) {
        configValue = configValue[fragment];
      } else {
        if (defaultValue !== undefined) {