mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-27 04:19:04 +08:00
#21269: Orchard.Layouts ContentPartElementHarvester null ref exception
Work Item: 21269
This commit is contained in:
committed by
Sipke Schoorstra
parent
5eb48b8eec
commit
ab46ba3e03
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user