From 8a40eb874fe0578955bf4f5e3ba31be5fe4d29c9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Fri, 21 Apr 2023 10:03:29 +0100 Subject: [PATCH] Fix soft crash with Element call widgets There was a race condition somewhere which would cause a soft crash of the whole app because WidgetPip here gets the currently active widget given a widget ID and room, but this can race and be null. --- src/components/views/pips/WidgetPip.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/pips/WidgetPip.tsx b/src/components/views/pips/WidgetPip.tsx index 57a06e89f41..0ffdaf3efe1 100644 --- a/src/components/views/pips/WidgetPip.tsx +++ b/src/components/views/pips/WidgetPip.tsx @@ -123,7 +123,7 @@ export const WidgetPip: FC = ({ widgetId, room, viewingRoom, onStartMovin pointerEvents="none" movePersistedElement={movePersistedElement} /> - {(call !== null || WidgetType.JITSI.matches(widget.type)) && ( + {(call !== null || WidgetType.JITSI.matches(widget?.type)) && (