From 0a0da58d95d81782d92cd9a03c80ea6d3945aef6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 31 Jul 2023 16:50:08 +0200 Subject: [PATCH] fix: check for the connector status definition in ATG MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/AutomaticTransactionGenerator.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 ] -- 2.34.1