Strict null check fixes
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / ui-services / AbstractUIService.ts
index 2b1267f35fd40b4584f29d87379782ebe3d419b7..1dd0ee274da3adb320134e66a4f3798dfe932ace 100644 (file)
@@ -92,7 +92,7 @@ export default abstract class AbstractUIService {
       // Log
       logger.error(`${this.logPrefix(moduleName, 'messageHandler')} Handle request error:`, error);
       responsePayload = {
-        hashIds: requestPayload.hashIds,
+        hashIds: requestPayload?.hashIds,
         status: ResponseStatus.FAILURE,
         command,
         requestPayload,
@@ -156,7 +156,7 @@ export default abstract class AbstractUIService {
   ): void {
     if (!Utils.isEmptyArray(payload.hashIds)) {
       payload.hashIds = payload.hashIds
-        .map(hashId => {
+        .map((hashId) => {
           if (this.uiServer.chargingStations.has(hashId) === true) {
             return hashId;
           }
@@ -167,7 +167,7 @@ export default abstract class AbstractUIService {
             )} Charging station with hashId '${hashId}' not found`
           );
         })
-        .filter(hashId => hashId !== undefined);
+        .filter((hashId) => hashId !== undefined);
     }
     const expectedNumberOfResponses = !Utils.isEmptyArray(payload.hashIds)
       ? payload.hashIds.length