Prepare code for strict type checking
[e-mobility-charging-stations-simulator.git] / src / worker / WorkerFactory.ts
index 2cda0ca2420f3ad4ae49fcfa64dcc55d7b7a261d..f4307be6bde3b159d5e35ccbf6159061046456bf 100644 (file)
@@ -8,7 +8,7 @@ import WorkerStaticPool from './WorkerStaticPool';
 import { isMainThread } from 'worker_threads';
 
 export default class WorkerFactory {
-  public static getWorkerImplementation<T>(workerScript: string, workerProcessType: WorkerProcessType, options?: WorkerOptions): WorkerAbstract {
+  public static getWorkerImplementation<T>(workerScript: string, workerProcessType: WorkerProcessType, options?: WorkerOptions): WorkerAbstract | null {
     if (!isMainThread) {
       throw new Error('Trying to get a worker implementation outside the main thread');
     }