Fix message handling on WebSocket server
[e-mobility-charging-stations-simulator.git] / src / charging-station / WebSocketServices / ui / 0.0.1 / UIService.ts
index 58d134fd4854ed4b9e92ea324c2043873d104602..8ca0c6dc9495624c0d0f376b89547f35cf157b48 100644 (file)
@@ -18,7 +18,7 @@ export default class UIService extends AbstractUIService {
 
   async handleMessage(command: ProtocolCommand, payload: Record<string, unknown>): Promise<void> {
     let messageResponse: Record<string, unknown>;
-    if (this.messageHandlers.has(command)) {
+    if (this.messageHandlers.has(command) && command !== ProtocolCommand.UNKNOWN) {
       try {
         // Call the method to build the response
         messageResponse = await this.messageHandlers.get(command)(payload);