fix: properly handle non existing configuration sections
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 11 Jun 2023 16:24:55 +0000 (18:24 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 11 Jun 2023 16:24:55 +0000 (18:24 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/utils/Configuration.ts

index 15a7bf0897288f18d61d499789a03dd0c059b45d..b54f3900988477d6e0ef77113323fc6c1bd8092a 100644 (file)
@@ -234,7 +234,7 @@ export class Configuration {
     const logConfiguration: LogConfiguration = {
       ...defaultLogConfiguration,
       ...deprecatedLogConfiguration,
-      ...Configuration.getConfig()?.log,
+      ...(Utils.hasOwnProp(Configuration.getConfig(), 'log') && Configuration.getConfig()?.log),
     };
     return logConfiguration;
   }
@@ -321,7 +321,8 @@ export class Configuration {
     const workerConfiguration: WorkerConfiguration = {
       ...defaultWorkerConfiguration,
       ...deprecatedWorkerConfiguration,
-      ...Configuration.getConfig()?.worker,
+      ...(Utils.hasOwnProp(Configuration.getConfig(), 'worker') &&
+        Configuration.getConfig()?.worker),
     };
     return workerConfiguration;
   }