- ++destinationWorkerNode.usage.tasks.stolen
- if (this.shallUpdateTaskFunctionWorkerUsage(destinationWorkerNodeKey)) {
+ if (destinationWorkerNode?.usage != null) {
+ ++destinationWorkerNode.usage.tasks.stolen
+ }
+ if (
+ this.shallUpdateTaskFunctionWorkerUsage(destinationWorkerNodeKey) &&
+ destinationWorkerNode.getTaskFunctionWorkerUsage(
+ task.name as string
+ ) != null
+ ) {