Skip to content

Commit

Permalink
Merge pull request #113 from EasyAbp/avoid-overwriting-with-null-values
Browse files Browse the repository at this point in the history
Avoid overwriting the encrypted values with null
  • Loading branch information
gdlcf88 authored May 6, 2024
2 parents f6c1cf0 + 8413880 commit 57283ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion common.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<LangVersion>latest</LangVersion>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<NoWarn>$(NoWarn);CS1591</NoWarn>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>EasyAbp Team</Authors>
Expand Down
11 changes: 11 additions & 0 deletions src/EasyAbp.Abp.SettingUi.Application/SettingUiAppService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@ public virtual async Task SetSettingValuesAsync(Dictionary<string, string> setti
continue;
}

// new value is null.
if (kv.Value.IsNullOrEmpty())
{
// it's an encrypted setting value, and it's currently on the tenant side.
if (setting.IsEncrypted && CurrentTenant.IsAvailable)
{
// don't update.
continue;
}
}

await SetSettingAsync(setting, kv.Value); // todo: needs permission check?
}
}
Expand Down

0 comments on commit 57283ea

Please sign in to comment.