#18843: Fixing potential null reference exception

Work Item: 18843

--HG--
branch : 1.5.x
This commit is contained in:
Sebastien Ros
2012-07-19 13:47:19 -07:00
parent 1926af7ca4
commit 398dda44ab

View File

@@ -43,6 +43,10 @@ namespace Orchard.Core.Navigation.Drivers {
}
protected override DriverResult Display(MenuWidgetPart part, string displayType, dynamic shapeHelper) {
return ContentShape( "Parts_MenuWidget", () => {
if(part.Menu == null) {
return null;
}
var menu = _menuService.GetMenu(part.Menu.Id);
if(menu == null) {