#19048: Fixing potential NRE if DisplayName is defined to null

Work Item: 19048

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-09-27 16:31:24 -07:00
parent 50003b1cb7
commit c95b408d68

View File

@@ -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;