#19044: Fixing possible NRE

Work Item: 19044

--HG--
branch : 1.x
This commit is contained in:
mjy78
2012-09-21 10:23:39 -07:00
parent cda84ffc46
commit c0698d11a0

View File

@@ -118,8 +118,8 @@ namespace Orchard.Core.Navigation.Drivers {
}
else {
IEnumerable<MenuItem> topLevelItems = menuItems.ToList();
if(part.StartLevel > 1) {
if (part.StartLevel > 1 && selectedPath != null) {
// the selected path will return the whole selected hierarchy
// intersecting will return the root selected menu item
topLevelItems = topLevelItems.Intersect(selectedPath.Where(x => x.Selected)).ToList();