From b47d68d7c1e315d6d111dd6471f3ac95fd7bfab1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 25 Mar 2022 12:34:24 +0100 Subject: [PATCH] Ensure comparison is not done on null or undefined MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 40e2c1b1..1d18e5b6 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -237,7 +237,10 @@ export default class ChargingStation { public getConnectorMaximumAvailablePower(connectorId: number): number { let connectorAmperageLimitationPowerLimit: number; - if (this.getAmperageLimitation() < this.stationInfo.maximumAmperage) { + if ( + !Utils.isNullOrUndefined(this.getAmperageLimitation()) && + this.getAmperageLimitation() < this.stationInfo.maximumAmperage + ) { const amperageLimitationPowerLimit = this.getCurrentOutType() === CurrentType.AC ? ACElectricUtils.powerTotal( -- 2.34.1