refactor: cleanup arguments namespace
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / 1.6 / OCPP16IncomingRequestService.ts
index dd40ffafd0d89c107fdd3bf3718d4a2615262896..75f63fee53e6206ad10ad0febd73af999d1d43ba 100644 (file)
@@ -950,11 +950,14 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     ) {
       // Authorization successful, start transaction
       if (
-        this.setRemoteStartTransactionChargingProfile(
-          chargingStation,
-          transactionConnectorId,
-          chargingProfile!,
-        ) === true
+        (chargingProfile &&
+          this.setRemoteStartTransactionChargingProfile(
+            chargingStation,
+            transactionConnectorId,
+            chargingProfile,
+            // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
+          ) === true) ||
+        !chargingProfile
       ) {
         connectorStatus.transactionRemoteStarted = true;
         if (
@@ -985,11 +988,14 @@ export class OCPP16IncomingRequestService extends OCPPIncomingRequestService {
     }
     // No authorization check required, start transaction
     if (
-      this.setRemoteStartTransactionChargingProfile(
-        chargingStation,
-        transactionConnectorId,
-        chargingProfile!,
-      ) === true
+      (chargingProfile &&
+        this.setRemoteStartTransactionChargingProfile(
+          chargingStation,
+          transactionConnectorId,
+          chargingProfile,
+          // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
+        ) === true) ||
+      !chargingProfile
     ) {
       connectorStatus.transactionRemoteStarted = true;
       if (