From c80726eaf6e7320414a364b3fca5da210a070023 Mon Sep 17 00:00:00 2001 From: Eric Hilse Date: Wed, 26 Nov 2025 08:40:33 -0700 Subject: [PATCH] fix: improve quota check logic in InviteUserButton for better reliability --- .../app/core/components/AppChrome/TopBar/InviteUserButton.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx b/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx index 270bb889c40..8a4c45c7608 100644 --- a/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx +++ b/public/app/core/components/AppChrome/TopBar/InviteUserButton.tsx @@ -20,7 +20,8 @@ export function InviteUserButton() { // Check if org_user quota is reached const userQuota = quotas?.find((quota) => quota.target === 'org_user'); - const isQuotaReached = userQuota ? userQuota.used! >= userQuota.limit! : false; + const isQuotaReached = + userQuota != null && userQuota.used != null && userQuota.limit != null && userQuota.used >= userQuota.limit; // Only show upgrade button on Grafana Cloud when quota is reached const shouldShowUpgrade = isCloudInstance && isQuotaReached;