Strict boolean check
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 11 Sep 2022 15:35:24 +0000 (17:35 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 11 Sep 2022 15:35:24 +0000 (17:35 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 30c8cf77bb971ee65a9e910fa2fbd1d8dc851001..17409e3a54af87972c15fbd2bdfc0c173e03b029 100644 (file)
@@ -1205,7 +1205,7 @@ export default class ChargingStation {
           const lastConnectorId = Utils.convertToInt(lastConnector);
           if (
             lastConnectorId === 0 &&
-            this.getUseConnectorId0(stationInfo) &&
+            this.getUseConnectorId0(stationInfo) === true &&
             stationInfo?.Connectors[lastConnector]
           ) {
             this.connectors.set(
@@ -1609,7 +1609,7 @@ export default class ChargingStation {
     );
   }
 
-  private getUseConnectorId0(stationInfo?: ChargingStationInfo): boolean | undefined {
+  private getUseConnectorId0(stationInfo?: ChargingStationInfo): boolean {
     const localStationInfo = stationInfo ?? this.stationInfo;
     return !Utils.isUndefined(localStationInfo.useConnectorId0)
       ? localStationInfo.useConnectorId0