From c74d19ad332b3e8bd22574d8a3c4d69cd1e957b8 Mon Sep 17 00:00:00 2001 From: Jake Janicke Date: Wed, 4 Mar 2026 13:56:30 -0600 Subject: [PATCH] Add more guards against undefined Signed-off-by: Jake Janicke --- src/tile/SpotlightTile.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tile/SpotlightTile.tsx b/src/tile/SpotlightTile.tsx index 93a1fbd9..77f72a2c 100644 --- a/src/tile/SpotlightTile.tsx +++ b/src/tile/SpotlightTile.tsx @@ -269,16 +269,17 @@ export const SpotlightTile: FC = ({ // isScreenShare only needs to check "audioEnabled$" but I wanted to be more specific // just in case more models are added in the future, since screen shares always have video const isScreenShare = - currentMedia && + currentMedia != null && "audioEnabled$" in currentMedia && "videoEnabled$" in currentMedia; const hasAudio$ = useBehavior( - isScreenShare && currentMedia?.audioEnabled$ + isScreenShare && (currentMedia as RemoteScreenShareViewModel).audioEnabled$ ? currentMedia.audioEnabled$ : constant(false), ); - const isLocalScreenShare = isScreenShare && currentMedia.local; + const isLocalScreenShare = + isScreenShare && (currentMedia as RemoteScreenShareViewModel)?.local; const screenShareLocallyMuted = useBehavior( isScreenShare ? (currentMedia as RemoteScreenShareViewModel).playbackMuted$