diff --git a/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx b/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx index 0972c777522..28df23c5a1c 100644 --- a/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx +++ b/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx @@ -147,7 +147,7 @@ describe('DashboardPageProxy', () => { act(() => { setup({ route: { routeName: DashboardRoutes.Home, component: () => null, path: '/' }, - match: { params: {}, isExact: true, path: '/', url: '/' }, + match: { params: { uid: '' }, isExact: true, path: '/', url: '/' }, }); }); @@ -176,7 +176,14 @@ describe('DashboardPageProxy', () => { act(() => { setup({ route: { routeName: DashboardRoutes.Home, component: () => null, path: '/' }, - match: { params: {}, isExact: true, path: '/', url: '/' }, + match: { + params: { + uid: '', + }, + isExact: true, + path: '/', + url: '/', + }, }); }); diff --git a/public/app/features/dashboard/containers/DashboardPageProxy.tsx b/public/app/features/dashboard/containers/DashboardPageProxy.tsx index b7b70b12f16..b4182e9f7ca 100644 --- a/public/app/features/dashboard/containers/DashboardPageProxy.tsx +++ b/public/app/features/dashboard/containers/DashboardPageProxy.tsx @@ -54,7 +54,7 @@ function DashboardPageProxy(props: DashboardPageProxyProps) { return null; } - if (dashboard.value && dashboard.value.dashboard.uid && dashboard.value.dashboard.uid !== props.match.params.uid) { + if (dashboard?.value?.dashboard?.uid !== props.match.params.uid) { return null; }