From bae1ddbed17921c6758c7140df9c10928453fb5a Mon Sep 17 00:00:00 2001 From: maliming <6908465+maliming@users.noreply.github.com> Date: Sun, 11 Oct 2020 19:22:24 +0800 Subject: [PATCH] Avoid decrypt null setting value. --- .../Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs index 6f5372a4cf2..5ef67cbc21d 100644 --- a/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs +++ b/framework/src/Volo.Abp.Settings/Volo/Abp/Settings/SettingProvider.cs @@ -35,7 +35,7 @@ public virtual async Task GetOrNullAsync(string name) //TODO: How to implement setting.IsInherited? var value = await GetOrNullValueFromProvidersAsync(providers, setting); - if (setting.IsEncrypted) + if (value != null && setting.IsEncrypted) { value = SettingEncryptionService.Decrypt(setting, value); } @@ -84,4 +84,4 @@ protected virtual async Task GetOrNullValueFromProvidersAsync( return null; } } -} \ No newline at end of file +}