X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fworker%2FWorkerFactory.ts;h=608e879859b9662cb093241aec71fccd7d0a9ea1;hb=de7b9e0583275225509c099f75a2801371da54d0;hp=d248d3bab765b5aabad6e9d5e2afb5dc773c5df0;hpb=1d8f226b47637e80c74106799208da5df93b2a04;p=e-mobility-charging-stations-simulator.git diff --git a/src/worker/WorkerFactory.ts b/src/worker/WorkerFactory.ts index d248d3ba..608e8798 100644 --- a/src/worker/WorkerFactory.ts +++ b/src/worker/WorkerFactory.ts @@ -16,12 +16,12 @@ export class WorkerFactory { workerScript: string, workerProcessType: WorkerProcessType, workerOptions?: WorkerOptions, - ): WorkerAbstract | null { + ): WorkerAbstract | undefined { if (!isMainThread) { throw new Error('Cannot get a worker implementation outside the main thread'); } workerOptions = { ...DEFAULT_WORKER_OPTIONS, ...workerOptions }; - let workerImplementation: WorkerAbstract | null = null; + let workerImplementation: WorkerAbstract; switch (workerProcessType) { case WorkerProcessType.workerSet: workerImplementation = new WorkerSet(workerScript, workerOptions);