mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing exceptions in MenuPartHandler
--HG-- branch : 1.x
This commit is contained in:
@@ -19,9 +19,12 @@ namespace Orchard.Core.Navigation.Handlers {
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
var part = context.ContentItem.As<MenuPart>();
|
||||
|
||||
if (part != null && context.ContentItem.TypeDefinition.Settings["Stereotype"] == "MenuItem") {
|
||||
if (part != null) {
|
||||
string stereotype;
|
||||
if (context.ContentItem.TypeDefinition.Settings.TryGetValue("Stereotype", out stereotype) && stereotype == "MenuItem") {
|
||||
context.Metadata.DisplayText = part.MenuText;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user