Prepare code for strict type checking
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCCP16IncomingRequestService.ts
index d74de14e9b84fc123e04882488d2b4465a6c0985..f230b3bcbad1b30ef21aeec40e866ee20ea33899 100644 (file)
@@ -190,7 +190,7 @@ export default class OCPP16IncomingRequestService extends OCPPIncomingRequestSer
       let clearedCP = false;
       for (const connector in this.chargingStation.connectors) {
         if (!Utils.isEmptyArray(this.chargingStation.getConnector(Utils.convertToInt(connector)).chargingProfiles)) {
-          this.chargingStation.getConnector(Utils.convertToInt(connector)).chargingProfiles.forEach((chargingProfile: OCPP16ChargingProfile, index: number) => {
+          this.chargingStation.getConnector(Utils.convertToInt(connector)).chargingProfiles?.forEach((chargingProfile: OCPP16ChargingProfile, index: number) => {
             let clearCurrentCP = false;
             if (chargingProfile.chargingProfileId === commandPayload.id) {
               clearCurrentCP = true;