Navigation: Set navtree to an empty array instead of null (#58919)

set navtree to  an empty array instead of null
This commit is contained in:
Leo 2022-11-21 09:43:21 +01:00 committed by GitHub
parent 14fbd44ac0
commit 4aa5dea96b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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() {