build: cleanup eslint configuration
[e-mobility-charging-stations-simulator.git] / src / worker / WorkerSet.ts
index c5df860ced4fc85b16e7067c805605b05db75e04..17b5b6dde201c85f4c0af0cbaf3574d33968fb03 100644 (file)
@@ -95,6 +95,7 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
       await waitWorkerExit;
       this.emitter?.emit(WorkerSetEvents.stopped, this.info);
       this.emitter?.emitDestroy();
+      this.emitter?.removeAllListeners();
       this.started = false;
     }
   }
@@ -104,7 +105,7 @@ export class WorkerSet extends WorkerAbstract<WorkerData> {
     if (!this.started) {
       throw new Error('Cannot add a WorkerSet element: not started');
     }
-    if (!this.workerSet) {
+    if (this.workerSet == null) {
       throw new Error("Cannot add a WorkerSet element: 'workerSet' property does not exist");
     }
     const workerSetElement = await this.getWorkerSetElement();