mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-22 21:02:08 +08:00
checked null part (#8543)
Co-authored-by: elena.lampugnani <elena.lampugnani@laser-group.com>
This commit is contained in:
@@ -40,17 +40,21 @@ namespace Orchard.ContentManagement.Handlers {
|
||||
return;
|
||||
|
||||
var templatePart = part.As<TPart>();
|
||||
if (templatePart != null) {
|
||||
var templateShape = context.New.EditorTemplate(TemplateName: _templateName, Model: templatePart, Prefix: _prefix);
|
||||
context.Shape.Zones[_location].Add(templateShape, _position);
|
||||
}
|
||||
}
|
||||
|
||||
protected override void UpdateEditorShape(UpdateEditorContext context, ContentPart part) {
|
||||
if (!_groupId.SafeNameEquals(context.GroupId, StringComparison.OrdinalIgnoreCase))
|
||||
return;
|
||||
|
||||
var templatePart = part.As<TPart>();
|
||||
if (templatePart != null) {
|
||||
context.Updater.TryUpdateModel(templatePart, _prefix, null, null);
|
||||
BuildEditorShape(context, part);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user