mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
Fixing potential NRE in LocalizationPartHandler by adding a nullcheck in LocalizationPartDriver
This commit is contained in:
@@ -60,7 +60,9 @@ namespace Orchard.Localization.Drivers {
|
||||
|
||||
protected override DriverResult Editor(LocalizationPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
var model = new EditLocalizationViewModel();
|
||||
if (updater != null && updater.TryUpdateModel(model, TemplatePrefix, null, null)) {
|
||||
|
||||
// Content culture has to be set only if it's not set already.
|
||||
if (updater != null && updater.TryUpdateModel(model, TemplatePrefix, null, null) && GetCulture(part) == null) {
|
||||
_localizationService.SetContentCulture(part, model.SelectedCulture);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user