diff --git a/frontend/src/components/Contexts/SignalRContext.tsx b/frontend/src/components/Contexts/SignalRContext.tsx index 83bbd2f7c..dd11aca6c 100644 --- a/frontend/src/components/Contexts/SignalRContext.tsx +++ b/frontend/src/components/Contexts/SignalRContext.tsx @@ -81,7 +81,14 @@ export const SignalRProvider: FC = ({ children }) => { }, [accessToken]) const registerEvent = (eventName: string, onMessageReceived: (username: string, message: string) => void) => { - if (connection) connection.on(eventName, (username, message) => onMessageReceived(username, message)) + if (connection) + connection.on(eventName, (username, message) => { + if (message === 'null') { + console.warn(`Received signalR message for event ${eventName} is 'null'`) + return + } + onMessageReceived(username, message) + }) } return (