From 12374b12b9324deeeced635217d73d347c36f07e Mon Sep 17 00:00:00 2001 From: Dmitry Lyzo Date: Fri, 18 Feb 2022 13:36:02 +0300 Subject: [PATCH] Fix null reference TypeScript error --- src/components/pages/UserProfilesPage.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/pages/UserProfilesPage.tsx b/src/components/pages/UserProfilesPage.tsx index 6837dcd7a..0444fd720 100644 --- a/src/components/pages/UserProfilesPage.tsx +++ b/src/components/pages/UserProfilesPage.tsx @@ -47,6 +47,11 @@ const UserProfilesPage: FunctionComponent = () => { const card = dom.parentWithClass(elem, 'card'); const userId = card.getAttribute('data-userid'); + if (!userId) { + console.error('Unexpected null user id'); + return; + } + const menuItems: MenuEntry[] = []; menuItems.push({