From: Jérôme Benoit Date: Sun, 17 Dec 2023 21:50:09 +0000 (+0100) Subject: fix: refine possible null exception fix at task response handling X-Git-Tag: v3.1.4~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=3c8a79b4b146fb20de682c19d8b409bfbdf05df4;p=poolifier.git fix: refine possible null exception fix at task response handling Signed-off-by: Jérôme Benoit --- 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 (