fix: refine CS registration error message
[e-mobility-charging-stations-simulator.git] / src / charging-station / ocpp / OCPPIncomingRequestService.ts
index 0ccf92fe78990be826da78d6da556df98c00dfc8..28de507774a281aeeb0d32b4d17b1348b45d50c5 100644 (file)
@@ -89,7 +89,7 @@ export abstract class OCPPIncomingRequestService extends AsyncResource {
     schema: JSONSchemaType<T>,
     payload: T,
   ): boolean {
-    if (chargingStation.getOcppStrictCompliance() === false) {
+    if (chargingStation.stationInfo?.ocppStrictCompliance === false) {
       return true;
     }
     if (this.jsonValidateFunctions.has(commandName) === false) {
@@ -104,7 +104,7 @@ export abstract class OCPPIncomingRequestService extends AsyncResource {
       validate.errors,
     );
     throw new OCPPError(
-      OCPPServiceUtils.ajvErrorsToErrorType(validate.errors!),
+      OCPPServiceUtils.ajvErrorsToErrorType(validate.errors),
       'Incoming request PDU is invalid',
       commandName,
       JSON.stringify(validate.errors, undefined, 2),