X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fcharging-station%2FBootstrap.ts;h=80470d00f3e5069dcf498111f32cc8b28f009a02;hb=f6cb17676bcd54d2aa28fe9f0eaa8797ac616873;hp=0c1eeeecb0386a009fba09797b02db651b15ea6e;hpb=df893e681229e94ec16b7902c79aed22b8694937;p=e-mobility-charging-stations-simulator.git diff --git a/src/charging-station/Bootstrap.ts b/src/charging-station/Bootstrap.ts index 0c1eeeec..80470d00 100644 --- a/src/charging-station/Bootstrap.ts +++ b/src/charging-station/Bootstrap.ts @@ -537,6 +537,11 @@ export class Bootstrap extends EventEmitter { templateFile: string, options?: ChargingStationOptions ): Promise { + if (!this.started && !this.starting) { + throw new BaseError( + 'Cannot add a charging station while charging stations simulator is not started' + ) + } await this.workerImplementation?.addElement({ index, templateFile: join(