From eb05044bc4ce10da24669981de68f85d6d3c5cf2 Mon Sep 17 00:00:00 2001
From: Michael Telatynski <7t3chguy@gmail.com>
Date: Mon, 6 Dec 2021 09:29:42 +0000
Subject: [PATCH] Fix labs exploding when lab group is empty (#7290)
---
.../views/settings/tabs/user/LabsUserSettingsTab.tsx | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx
index ad3854c1a6..440ce2f7ed 100644
--- a/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx
+++ b/src/components/views/settings/tabs/user/LabsUserSettingsTab.tsx
@@ -88,11 +88,11 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
);
});
- groups.get(LabGroup.Widgets).push(
+ groups.getOrCreate(LabGroup.Widgets, []).push(
,
);
- groups.get(LabGroup.Experimental).push(
+ groups.getOrCreate(LabGroup.Experimental, []).push(
,
);
@@ -101,12 +101,12 @@ export default class LabsUserSettingsTab extends React.Component<{}, IState> {
,
);
- groups.get(LabGroup.Analytics).push(
+ groups.getOrCreate(LabGroup.Analytics, []).push(
,
);
if (this.state.showHiddenReadReceipts) {
- groups.get(LabGroup.Messaging).push(
+ groups.getOrCreate(LabGroup.Messaging, []).push(
,
);
}