From 3c8a79b4b146fb20de682c19d8b409bfbdf05df4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 17 Dec 2023 22:50:09 +0100 Subject: [PATCH] fix: refine possible null exception fix at task response handling 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 635b8af4..ea07dc8f 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1759,7 +1759,7 @@ export abstract class AbstractPool< this.afterTaskExecutionHook(workerNodeKey, message) this.workerChoiceStrategyContext.update(workerNodeKey) this.promiseResponseMap.delete(taskId as string) - workerNode.emit('taskFinished', taskId) + workerNode?.emit('taskFinished', taskId) if (this.opts.enableTasksQueue === true) { const workerNodeTasksUsage = workerNode.usage.tasks if ( -- 2.34.1