mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#19714: Fixing possible NRE in MenuItemLink shape
Work Item: 19714 --HG-- branch : 1.x
This commit is contained in:
@@ -104,9 +104,11 @@ namespace Orchard.Core.Shapes {
|
||||
var menu = menuItem.Menu;
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + EncodeAlternateElement(menu.MenuName));
|
||||
|
||||
var contentType = ((IContent)menuItem.Content).ContentItem.ContentType;
|
||||
if(contentType != null) {
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + contentType);
|
||||
if (menuItem.Content != null) {
|
||||
var contentType = ((IContent) menuItem.Content).ContentItem.ContentType;
|
||||
if (contentType != null) {
|
||||
menuItem.Metadata.Alternates.Add("MenuItemLink__" + contentType);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user