From cea399c8027c4420ae869f177d9d518d4b51775f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 15 Aug 2023 16:36:43 +0200 Subject: [PATCH] fix: test task function name only if the received from workers MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/pools/abstract-pool.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 4c08671e..d36e8a47 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -672,7 +672,11 @@ export abstract class AbstractPool< ) { reject(new TypeError('name argument must not be an empty string')) } - if (name != null && !this.taskFunctions.includes(name)) { + if ( + name != null && + this.taskFunctions != null && + !this.taskFunctions.includes(name) + ) { reject( new Error(`Task function '${name}' is not registered in the pool`) ) -- 2.34.1