From: Jérôme Benoit Date: Tue, 20 Oct 2020 22:13:56 +0000 (+0200) Subject: Move attributes init to the right place. X-Git-Tag: v1.0.1-0~254 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=fa9bcef2596007f2ff9a7706aedefbb6c097c397;p=e-mobility-charging-stations-simulator.git Move attributes init to the right place. Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.js b/src/charging-station/ChargingStation.js index 03ad43c3..2c699be8 100644 --- a/src/charging-station/ChargingStation.js +++ b/src/charging-station/ChargingStation.js @@ -14,6 +14,7 @@ class ChargingStation { constructor(index, stationTemplateFile) { this._index = index; this._stationTemplateFile = stationTemplateFile; + this._connectors = {}; this._initialize(); this._isSocketRestart = false; @@ -70,9 +71,6 @@ 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) {