From be0e9949cf90890691afb9bc52a38509ffee0dbd Mon Sep 17 00:00:00 2001 From: a-wing <1@233.email> Date: Mon, 23 Dec 2024 21:48:30 +0800 Subject: [PATCH] fix(webapp): console log error streams null --- webapp/components/layout.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/webapp/components/layout.tsx b/webapp/components/layout.tsx index 44bb680..c1e9656 100644 --- a/webapp/components/layout.tsx +++ b/webapp/components/layout.tsx @@ -30,14 +30,16 @@ export default function Layout(props: { meetingId: string }) { const refresh = async () => { const data = (await getRoom(props.meetingId)).streams - const r = Object.keys(data) - .filter(i => i !== localStreamId) - .filter(i => !!i) - .reduce((map, i) => { - map[i] = data[i] - return map - }, {} as { [_: string]: Stream }) - setRemoteUserStatus(r) + if (data) { + const r = Object.keys(data) + .filter(i => i !== localStreamId) + .filter(i => !!i) + .reduce((map, i) => { + map[i] = data[i] + return map + }, {} as { [_: string]: Stream }) + setRemoteUserStatus(r) + } } const callEnd = async () => {