From: Jérôme Benoit Date: Mon, 22 May 2023 18:38:27 +0000 (+0200) Subject: fix: properly fallback to template OCPP configuration X-Git-Tag: v1.2.14~24 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=60655b2618d2d049b20efb78c1a75a75c2874db6;p=e-mobility-charging-stations-simulator.git fix: properly fallback to template OCPP configuration Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 6a27d1d6..2fed2cc4 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -1647,9 +1647,11 @@ export class ChargingStation { } private getOcppConfigurationFromFile(): ChargingStationOcppConfiguration | undefined { - if (this.getOcppPersistentConfiguration() === true) { - return { configurationKey: this.getConfigurationFromFile()?.configurationKey }; + const configurationKey = this.getConfigurationFromFile()?.configurationKey; + if (this.getOcppPersistentConfiguration() === true && configurationKey) { + return { configurationKey }; } + return undefined; } private getOcppConfiguration(): ChargingStationOcppConfiguration | undefined {