Strict null check fixes
[e-mobility-charging-stations-simulator.git] / src / charging-station / UIServiceWorkerBroadcastChannel.ts
index fa9236abad6f478c6fa043c3bf611248b2c27820..0e84b3a120af43f277445b3ed3f98327fbb90862 100644 (file)
@@ -47,7 +47,7 @@ export default class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChan
       this.responses.get(uuid)?.responsesReceived <= this.responses.get(uuid)?.responsesExpected
     ) {
       this.responses.get(uuid).responsesReceived++;
-      this.responses.get(uuid).responses.push(responsePayload);
+      this.responses.get(uuid)?.responses.push(responsePayload);
     }
     if (
       this.responses.get(uuid)?.responsesReceived === this.responses.get(uuid)?.responsesExpected
@@ -74,7 +74,7 @@ export default class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChan
             return hashId;
           }
         })
-        .filter(hashId => hashId !== undefined),
+        .filter((hashId) => hashId !== undefined),
       ...(responsesStatus === ResponseStatus.FAILURE && {
         hashIdsFailed: this.responses
           .get(uuid)
@@ -83,17 +83,17 @@ export default class UIServiceWorkerBroadcastChannel extends WorkerBroadcastChan
               return hashId;
             }
           })
-          .filter(hashId => hashId !== undefined),
+          .filter((hashId) => hashId !== undefined),
       }),
       ...(responsesStatus === ResponseStatus.FAILURE && {
         responsesFailed: this.responses
           .get(uuid)
-          ?.responses.map(response => {
+          ?.responses.map((response) => {
             if (response.status === ResponseStatus.FAILURE) {
               return response;
             }
           })
-          .filter(response => response !== undefined),
+          .filter((response) => response !== undefined),
       }),
     };
   }