From 041e3c618093c331112ee96a9524017a3cb670c6 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 3 Jul 2024 16:29:27 +0200 Subject: [PATCH] fix(ui): dashboard null check --- .../components/Dashboard/components/AddToDashboardButton.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/app/components/Dashboard/components/AddToDashboardButton.tsx b/frontend/app/components/Dashboard/components/AddToDashboardButton.tsx index c7139afb3..054576024 100644 --- a/frontend/app/components/Dashboard/components/AddToDashboardButton.tsx +++ b/frontend/app/components/Dashboard/components/AddToDashboardButton.tsx @@ -16,7 +16,7 @@ function AddToDashboardButton({metricId}: Props) { label: i.name, value: i.dashboardId, })); - const [selectedId, setSelectedId] = React.useState(dashboardOptions[0].value); + const [selectedId, setSelectedId] = React.useState(dashboardOptions[0]?.value); const onSave = (close: any) => { const dashboard = dashboardStore.getDashboard(selectedId)