Fix undefined at startup.
authorJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 21:53:26 +0000 (23:53 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Tue, 20 Oct 2020 21:53:26 +0000 (23:53 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.js

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