Empty string handling fixes
[e-mobility-charging-stations-simulator.git] / src / charging-station / ui-server / UIWebSocketServer.ts
index 27d8ce844b7dc47d5d2039deb2e9c78e3c6f5adb..d6240e31ef2dadb43f7ccbc2121a6442903252be 100644 (file)
@@ -4,13 +4,13 @@ import type internal from 'stream';
 import { StatusCodes } from 'http-status-codes';
 import WebSocket, { type RawData, WebSocketServer } from 'ws';
 
+import { AbstractUIServer } from './AbstractUIServer';
+import { UIServerUtils } from './UIServerUtils';
 import type { UIServerConfiguration } from '../../types/ConfigurationData';
 import type { ProtocolRequest, ProtocolResponse } from '../../types/UIProtocol';
 import { WebSocketCloseEventStatusCode } from '../../types/WebSocket';
 import logger from '../../utils/Logger';
 import Utils from '../../utils/Utils';
-import { AbstractUIServer } from './AbstractUIServer';
-import { UIServerUtils } from './UIServerUtils';
 
 const moduleName = 'UIWebSocketServer';
 
@@ -49,7 +49,7 @@ export default class UIWebSocketServer extends AbstractUIServer {
         this.responseHandlers.set(requestId, ws);
         this.uiServices
           .get(version)
-          .requestHandler(request)
+          ?.requestHandler(request)
           .catch(() => {
             /* Error caught by AbstractUIService */
           });