diff --git a/tgui/packages/tgui-panel/chat/middleware.js b/tgui/packages/tgui-panel/chat/middleware.js index dc81955e906..ecafbd23641 100644 --- a/tgui/packages/tgui-panel/chat/middleware.js +++ b/tgui/packages/tgui-panel/chat/middleware.js @@ -87,7 +87,13 @@ export const chatMiddleware = (store) => { loadChatFromStorage(store); } if (type === 'chat/message') { - const payload_obj = JSON.parse(payload); + let payload_obj; + try { + payload_obj = JSON.parse(payload); + } catch (err) { + return; + } + const sequence = payload_obj.sequence; if (sequences.includes(sequence)) { return;