From 2f70f96f076d2689ff4f392dd32f8499cb2e4100 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 29 Aug 2021 15:31:58 +0200 Subject: [PATCH] Add a sanity check at worker implementation options check MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/worker/WorkerFactory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index d97e9604..55cb1da7 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -19,7 +19,7 @@ export default class WorkerFactory { throw new Error('Trying to get a worker implementation outside the main thread'); } options = options ?? {} as WorkerOptions; - options.startDelay = options.startDelay ?? Constants.WORKER_START_DELAY; + options.startDelay = options?.startDelay ?? Constants.WORKER_START_DELAY; options.poolOptions = options?.poolOptions ?? {} as PoolOptions; options?.messageHandler && (options.poolOptions.messageHandler = options.messageHandler); let workerImplementation: WorkerAbstract = null; -- 2.34.1