From 72ac08cc7bb1eacd72b9f15906b319985944bc41 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Mon, 21 Nov 2022 04:02:19 -0500 Subject: [PATCH] [v9.3.x] Navigation: Set navtree to an empty array instead of null (#59010) Navigation: Set navtree to an empty array instead of null (#58919) set navtree to an empty array instead of null (cherry picked from commit 4aa5dea96bd2f9bb137be704e1f69c09c00cdfb3) Co-authored-by: Leo <108552997+lpskdl@users.noreply.github.com> --- pkg/services/navtree/models.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/services/navtree/models.go b/pkg/services/navtree/models.go index 728dc6cda51..0ff907e17fa 100644 --- a/pkg/services/navtree/models.go +++ b/pkg/services/navtree/models.go @@ -140,6 +140,10 @@ func (root *NavTreeRoot) RemoveEmptySectionsAndApplyNewInformationArchitecture(t node.Url = node.Children[0].Url } } + + if len(root.Children) < 1 { + root.Children = make([]*NavLink, 0) + } } func (root *NavTreeRoot) Sort() {