From: Jérôme Benoit Date: Thu, 19 Oct 2023 09:14:41 +0000 (+0200) Subject: fix: avoid null exception at checking worker node readiness X-Git-Tag: v3.0.3~2 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=535fd8d5bfd0d751e1c40ed77de7514520e89e1f;p=poolifier.git fix: avoid null exception at checking worker node readiness Signed-off-by: Jérôme Benoit --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 838d0e68..ba33eef2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Avoid null exception at sending message to worker. +- Avoid null exception at checking worker node readiness. ## [3.0.2] - 2023-10-17 diff --git a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts index 7a64a7e5..86692de9 100644 --- a/src/pools/selection-strategies/abstract-worker-choice-strategy.ts +++ b/src/pools/selection-strategies/abstract-worker-choice-strategy.ts @@ -123,7 +123,7 @@ export abstract class AbstractWorkerChoiceStrategy< * @returns Whether the worker node is ready or not. */ protected isWorkerNodeReady (workerNodeKey: number): boolean { - return this.pool.workerNodes[workerNodeKey]?.info.ready ?? false + return this.pool.workerNodes[workerNodeKey]?.info?.ready ?? false } /**