From 78060ded37eb246f2b4259f5312acef756186c62 Mon Sep 17 00:00:00 2001 From: cha0s Date: Fri, 12 Jul 2024 01:53:15 -0500 Subject: [PATCH] chore: tidy --- app/react-components/ui.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/react-components/ui.jsx b/app/react-components/ui.jsx index a67956f..34be0d9 100644 --- a/app/react-components/ui.jsx +++ b/app/react-components/ui.jsx @@ -237,12 +237,15 @@ export default function Ui({disconnected}) { for (const id in payload) { const entity = ecs.get(id); const update = payload[id]; + if (!update) { + continue; + } if (update.Sound?.play) { for (const sound of update.Sound.play) { (new Audio(sound)).play(); } } - if (update?.MainEntity) { + if (update.MainEntity) { setMainEntity(localMainEntity = id); } if (localMainEntity === id) { @@ -275,7 +278,7 @@ export default function Ui({disconnected}) { return () => { document.body.removeEventListener('contextmenu', onContextMenu); }; - }, []) + }, []); return (