From 25baaaf241b827786fd7c11a77c9a0f3431608d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 11 Jun 2023 18:24:55 +0200 Subject: [PATCH] fix: properly handle non existing configuration sections MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/Configuration.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/utils/Configuration.ts b/src/utils/Configuration.ts index 15a7bf08..b54f3900 100644 --- a/src/utils/Configuration.ts +++ b/src/utils/Configuration.ts @@ -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; } -- 2.34.1