Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
*/
protected run (task: Task<Data>): void {
const { name, taskId, data } = task
- const fn = this.taskFunctions.get(name ?? DEFAULT_TASK_NAME)
- if (fn == null) {
+ if (!this.taskFunctions.has(name ?? DEFAULT_TASK_NAME)) {
this.sendToMainWorker({
workerError: {
name: name as string,
})
return
}
+ const fn = this.taskFunctions.get(name ?? DEFAULT_TASK_NAME)
if (isAsyncFunction(fn)) {
this.runInAsyncScope(this.runAsync.bind(this), this, fn, task)
} else {