From 922ddd080be6261b7d78e661f5cc05bcd48041dd Mon Sep 17 00:00:00 2001 From: Eric Hilse Date: Wed, 26 Nov 2025 08:46:20 -0700 Subject: [PATCH] fix: wrap button click handling in try-catch for improved error handling --- .../components/AppChrome/TopBar/InviteUserButton.tsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx b/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx index 8a4c45c7608..c9622d1efc1 100644 --- a/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx +++ b/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx @@ -31,10 +31,14 @@ export function InviteUserButton() { } const handleClick = () => { - if (shouldShowUpgrade) { - performUpgradeClick('top_bar_right', 'upgrade-user-top-bar'); - } else { - performInviteUserClick('top_bar_right', 'invite-user-top-bar'); + try { + if (shouldShowUpgrade) { + performUpgradeClick('top_bar_right', 'upgrade-user-top-bar'); + } else { + performInviteUserClick('top_bar_right', 'invite-user-top-bar'); + } + } catch (error) { + console.error('Failed to handle button click:', error); } };