From: Jérôme Benoit Date: Thu, 4 Jan 2024 09:56:59 +0000 (+0100) Subject: fix: avoid possible nullish exception X-Git-Tag: v3.1.17~10 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;ds=sidebyside;h=b4f8aca8acc81949c7412adff1e1a7367e2aa93b;hp=-c;p=poolifier.git fix: avoid possible nullish exception Signed-off-by: Jérôme Benoit --- b4f8aca8acc81949c7412adff1e1a7367e2aa93b diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 65ace6d9..0c366911 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1244,7 +1244,8 @@ export abstract class AbstractPool< ) { this.redistributeQueuedTasks(this.workerNodes.indexOf(workerNode)) } - workerNode.terminate().catch(error => { + // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition + workerNode?.terminate().catch(error => { this.emitter?.emit(PoolEvents.error, error) }) })