From: Jérôme Benoit Date: Thu, 30 Nov 2023 11:20:59 +0000 (+0100) Subject: fix: only reset defined ATG connector status X-Git-Tag: v1.2.28~5 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=37e207d110f051eac4228f604d0b4e7b14764457;p=e-mobility-charging-stations-simulator.git fix: only reset defined ATG connector status Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/AutomaticTransactionGenerator.ts b/src/charging-station/AutomaticTransactionGenerator.ts index efc3769a..d76766cc 100644 --- a/src/charging-station/AutomaticTransactionGenerator.ts +++ b/src/charging-station/AutomaticTransactionGenerator.ts @@ -398,16 +398,19 @@ export class AutomaticTransactionGenerator extends AsyncResource { } private resetConnectorStatus(connectorStatus: Status | undefined): void { + if (connectorStatus === undefined) { + return; + } delete connectorStatus?.startDate; delete connectorStatus?.lastRunDate; delete connectorStatus?.stopDate; delete connectorStatus?.stoppedDate; if ( !this.started && - (connectorStatus?.start === true || + (connectorStatus.start === true || this.chargingStation.getAutomaticTransactionGeneratorConfiguration().enable === false) ) { - connectorStatus!.start = false; + connectorStatus.start = false; } }