Fixed potential NRE issue with SearchSettingsPart export handler.

This issue occured if no SearchFields were stored yet and the user exports Site Settings.
This commit is contained in:
Sipke Schoorstra
2015-04-23 12:30:13 +02:00
parent 96b41fb9b7
commit 5de70ecdef

View File

@@ -74,7 +74,7 @@ namespace Orchard.Search.Drivers {
}
protected override void Exporting(SearchSettingsPart part, ExportContentContext context) {
context.Element(part.PartDefinition.Name).Add(new XAttribute("SearchFields", part.Retrieve<string>("SearchFields")));
context.Element(part.PartDefinition.Name).SetAttributeValue("SearchFields", part.Retrieve<string>("SearchFields"));
}
protected override void Importing(SearchSettingsPart part, ImportContentContext context) {