Skip to content

Commit

Permalink
Merge pull request #624 from santhoshb-msft/sb-appconfigbugfix
Browse files Browse the repository at this point in the history
update appconfig to save empty string instead of null #619
  • Loading branch information
santhoshb-msft authored Dec 27, 2023
2 parents 3edef33 + 9a22bb4 commit b24c563
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/AdminSite/Controllers/ApplicationConfigController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public IActionResult ApplicationConfigDetails(int Id)
[ValidateAntiForgeryToken]
public IActionResult ApplicationConfigDetails(ApplicationConfiguration appConfig)
{
appConfig.Value = appConfig.Value ?? string.Empty;
this.appConfigService.SaveAppConfig(appConfig);

this.ModelState.Clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
@Model.Name
</td>
<td>
@if (@Model.Name.Equals("SMTPPassword") && @Model.Value.Length > 5)
@if (@Model.Name.Equals("SMTPPassword") && @Model?.Value?.Length > 5)
{
@Html.EditorFor(model => model.Value, new { htmlAttributes = new { type ="password", @class = "form-control" } })
}
Expand Down
2 changes: 1 addition & 1 deletion src/AdminSite/Views/ApplicationConfig/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@item.Name
</td>
<td class="text-left">
@if (@item.Name.Equals("SMTPPassword") && @item.Value.Length > 5)
@if (@item.Name.Equals("SMTPPassword") && @item?.Value?.Length > 5)
{
@String.Format("{0}{1}", @item.Value.Substring(0,5), "****************");
}
Expand Down

0 comments on commit b24c563

Please sign in to comment.