From: Jérôme Benoit Date: Tue, 20 Oct 2020 21:53:26 +0000 (+0200) Subject: Fix undefined at startup. X-Git-Tag: v1.0.1-0~255 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=77f1372f4d85209e56ab05edc67309d17f48decd;p=e-mobility-charging-stations-simulator.git Fix undefined at startup. Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.js b/src/charging-station/ChargingStation.js index a37c3a45..03ad43c3 100644 --- a/src/charging-station/ChargingStation.js +++ b/src/charging-station/ChargingStation.js @@ -70,6 +70,9 @@ class ChargingStation { // FIXME: Handle shrinking the number of connectors if (!this._connectors || (this._connectors && this._connectorsConfigurationHash !== connectorsConfigHash)) { this._connectorsConfigurationHash = connectorsConfigHash; + if (!this._connectors) { + this._connectors = {}; + } // Determine number of customized connectors let lastConnector; for (lastConnector in connectorsConfig) {