#21269: Orchard.Layouts ContentPartElementHarvester null ref exception

Work Item: 21269
This commit is contained in:
Kegan Maher
2015-03-17 13:03:24 +01:00
committed by Sipke Schoorstra
parent 5eb48b8eec
commit ab46ba3e03

View File

@@ -35,7 +35,8 @@ namespace Orchard.Layouts.Providers {
return contentParts.Select(contentPart => {
var partDescription = contentPart.Settings.TryGetModel<ContentPartSettings>().Description;
var partSettings = contentPart.Settings.TryGetModel<ContentPartSettings>();
var partDescription = partSettings != null ? partSettings.Description : null;
var description = T(!String.IsNullOrWhiteSpace(partDescription) ? partDescription : contentPart.Name);
return new ElementDescriptor(elementType, contentPart.Name, T(contentPart.Name.CamelFriendly()), description, contentPartElement.Category) {
Display = displayContext => Displaying(displayContext),