Move attributes init to the right place.
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 22:13:56 +0000 (00:13 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 22:13:56 +0000 (00:13 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.js

index 03ad43c38857a8a19f61aee3a2e74ca210a49c93..2c699be8618bd394ddfc6b66258f1506be3e7055 100644 (file)
@@ -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) {