Fixes chat bluescreen (#79821)

## About The Pull Request
Adds a chat reliability layer reliability layer

<details>
<summary>more info</summary>

json.parse claims another

![d86](https://github.com/tgstation/tgstation/assets/42397676/c7d864f2-b5d6-4c5d-95b4-deece37c808d)

javascript completely opaque about what throws. innocuous function not
wrapped in try/catch block

</details>

## Why It's Good For The Game
No bluescreen?
Fixes #79814
## Changelog
🆑
fix: Chat shouldn't bluescreen at the start of the round
/🆑
This commit is contained in:
Jeremiah
2023-11-18 22:23:50 -05:00
committed by GitHub
parent e0b5ee3df9
commit cfeb2d84eb
+7 -1
View File
@@ -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;