Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit cc84206

Browse files
committed
Don't remove live tiles that don't exist
Signed-off-by: Robin Townsend <[email protected]>
1 parent f805b65 commit cc84206

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/views/elements/AppTile.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ export default class AppTile extends React.Component<IProps, IState> {
132132

133133
public static removeLiveTile(widgetId: string, roomId: string): void {
134134
const uid = WidgetUtils.calcWidgetUid(widgetId, roomId);
135-
const refs = this.liveTilesByUid.get(uid) ?? 0;
136-
this.liveTilesByUid.set(uid, refs - 1);
135+
const refs = this.liveTilesByUid.get(uid);
136+
if (refs) this.liveTilesByUid.set(uid, refs - 1);
137137
}
138138

139139
public static isLive(widgetId: string, roomId: string): boolean {

0 commit comments

Comments
 (0)