fix: null exception when a task errored
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 11 Jul 2024 17:05:38 +0000 (19:05 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Thu, 11 Jul 2024 17:05:38 +0000 (19:05 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index c009f20ac12458a13a354b8d232c9f6c325d2487..89a256ae34ac40aa704be84232605c1216793a3e 100644 (file)
@@ -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,