From: Jérôme Benoit Date: Mon, 31 Jul 2023 14:50:08 +0000 (+0200) Subject: fix: check for the connector status definition in ATG X-Git-Tag: v1.2.20~58 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=0a0da58d95d81782d92cd9a03c80ea6d3945aef6;p=e-mobility-charging-stations-simulator.git fix: check for the connector status definition in ATG Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index ae4beec8..dfab482a 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -353,7 +353,9 @@ export class AutomaticTransactionGenerator extends AsyncResource { } private getConnectorStatus(connectorId: number): Status { - const connectorStatus = this.chargingStation.getAutomaticTransactionGeneratorStatuses() + const connectorStatus = this.chargingStation.getAutomaticTransactionGeneratorStatuses()?.[ + connectorId + ] ? cloneObject(this.chargingStation.getAutomaticTransactionGeneratorStatuses()!)[ connectorId ]