[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 4aa5dea96b)

Co-authored-by: Leo <108552997+lpskdl@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-11-21 10:02:19 +01:00
committed by GitHub
co-authored by Leo
parent 90946b68a2
commit 72ac08cc7b
+4
View File
@@ -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() {