mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#19048: Fixing potential NRE if DisplayName is defined to null
Work Item: 19048 --HG-- branch : 1.x
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
@using Orchard.ContentManagement
|
||||
@using Orchard.Utility.Extensions
|
||||
|
||||
@{
|
||||
var typeDisplayName = Model.ContentItem.TypeDefinition.DisplayName;
|
||||
ContentItem contentItem = Model.ContentItem;
|
||||
var typeDisplayName = contentItem.TypeDefinition.DisplayName ?? contentItem.ContentType.CamelFriendly();
|
||||
var pageTitle = T("New {0}", typeDisplayName);
|
||||
|
||||
Layout.Title = (string)pageTitle.Text;
|
||||
|
Reference in New Issue
Block a user