mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
Fixes chat bluescreen (#79821)
## About The Pull Request Adds a chat reliability layer reliability layer <details> <summary>more info</summary> json.parse claims another  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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user