From: Jérôme Benoit Date: Thu, 11 Jul 2024 17:05:38 +0000 (+0200) Subject: fix: null exception when a task errored X-Git-Tag: v4.0.18~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=ac5ee55ef0ad7dc29f3d0bc6906e2e127dc2e026;p=poolifier.git fix: null exception when a task errored Signed-off-by: Jérôme Benoit --- diff --git a/src/pools/abstract-pool.ts b/src/pools/abstract-pool.ts index c009f20a..89a256ae 100644 --- a/src/pools/abstract-pool.ts +++ b/src/pools/abstract-pool.ts @@ -1442,16 +1442,15 @@ export abstract class AbstractPool< } if ( this.shallUpdateTaskFunctionWorkerUsage(workerNodeKey) && + message.taskPerformance?.name != null && this.workerNodes[workerNodeKey].getTaskFunctionWorkerUsage( - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - message.taskPerformance!.name + message.taskPerformance.name ) != null ) { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const taskFunctionWorkerUsage = this.workerNodes[ workerNodeKey - // eslint-disable-next-line @typescript-eslint/no-non-null-assertion - ].getTaskFunctionWorkerUsage(message.taskPerformance!.name)! + ].getTaskFunctionWorkerUsage(message.taskPerformance.name)! updateTaskStatisticsWorkerUsage(taskFunctionWorkerUsage, message) updateRunTimeWorkerUsage( this.workerChoiceStrategiesContext,