From: Jérôme Benoit Date: Thu, 9 May 2024 13:24:03 +0000 (+0200) Subject: fix: ensure task function worker usage is defined before usage X-Git-Tag: v4.0.5~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7aa2f4763d2ca23123ffadaf7c83f624f8374d84;p=poolifier.git fix: ensure task function worker usage is defined before usage Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index 73f4e31a..2f91df9d 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1670,7 +1670,7 @@ export abstract class AbstractPool< ): void { const workerNode = this.workerNodes[workerNodeKey] // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition - if (workerNode.usage != null) { + if (workerNode?.usage != null) { ++workerNode.usage.tasks.sequentiallyStolen } const taskFunctionWorkerUsage =