fix: avoid null exception at checking worker node readiness
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 19 Oct 2023 09:14:41 +0000 (11:14 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 19 Oct 2023 09:14:41 +0000 (11:14 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
CHANGELOG.md
src/pools/selection-strategies/abstract-worker-choice-strategy.ts

index 838d0e6816d6015bd283b9c89c19e00f825c4e63..ba33eef23863cf7cc45a7ff6d6c8526142674d26 100644 (file)
@@ -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
 
index 7a64a7e563f9d6d8e1fffdac9ce91d1bc64d5b1e..86692de92f50c6cc9b1c1c7bcb3e1e960d5693e5 100644 (file)
@@ -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
   }
 
   /**