refactor: more stricter type checking in condition
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 16:38:35 +0000 (17:38 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 20 Nov 2023 16:38:35 +0000 (17:38 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 6d4b45f3459b426bdc27c62b7602acf059484f1e..0ab700a5d0848836d1aaf26e63bc6e8ebb6b1d39 100644 (file)
@@ -1314,7 +1314,7 @@ export class ChargingStation extends EventEmitter {
     } else if (
       this.stationInfo?.supervisionUrlOcppConfiguration === false &&
       isNotEmptyString(this.stationInfo?.supervisionUrlOcppKey) &&
-      getConfigurationKey(this, this.stationInfo.supervisionUrlOcppKey!)
+      !isNullOrUndefined(getConfigurationKey(this, this.stationInfo.supervisionUrlOcppKey!))
     ) {
       deleteConfigurationKey(this, this.stationInfo.supervisionUrlOcppKey!, { save: false });
     }