From 043c1be572116f1f0e103ca86ef4b38b67c90016 Mon Sep 17 00:00:00 2001 From: kay delaney <45561153+kaydelaney@users.noreply.github.com> Date: Wed, 23 Feb 2022 14:47:56 +0000 Subject: [PATCH] NewNavigation: Fix failing e2e test (#45779) --- public/app/core/reducers/navBarTree.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/core/reducers/navBarTree.ts b/public/app/core/reducers/navBarTree.ts index 83656addacb..61fbbd3dd13 100644 --- a/public/app/core/reducers/navBarTree.ts +++ b/public/app/core/reducers/navBarTree.ts @@ -2,7 +2,7 @@ import { createSlice, PayloadAction } from '@reduxjs/toolkit'; import { NavModelItem } from '@grafana/data'; import config from 'app/core/config'; -const defaultPins = (config.bootData.navTree as NavModelItem[]).map((n) => n.id).join(','); +const defaultPins = ((config.bootData?.navTree as NavModelItem[]) ?? []).map((n) => n.id).join(','); const storedPins = (window.localStorage.getItem('pinnedNavItems') ?? defaultPins).split(','); export const initialState: NavModelItem[] = ((config.bootData?.navTree ?? []) as NavModelItem[]).map(