Fix soft crash with Element call widgets (#10684)

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.

Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
This commit is contained in:
David Baker 2023-04-28 09:13:26 +01:00 committed by GitHub
parent 30ac950523
commit 4c72cceb70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -123,7 +123,7 @@ export const WidgetPip: FC<Props> = ({ widgetId, room, viewingRoom, onStartMovin
pointerEvents="none"
movePersistedElement={movePersistedElement}
/>
{(call !== null || WidgetType.JITSI.matches(widget.type)) && (
{(call !== null || WidgetType.JITSI.matches(widget?.type)) && (
<Toolbar className="mx_WidgetPip_footer">
<RovingAccessibleTooltipButton
onClick={onLeaveClick}