Merge pull request #612 from sbwalker/master

fix #600 Unhandled exception opening a user's profile
This commit is contained in:
Shaun Walker 2020-06-14 21:14:46 -04:00 committed by GitHub
commit c8630d7b05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -73,7 +73,7 @@ else
}
</TabPanel>
<TabPanel Name="Profile">
@if (profiles != null)
@if (profiles != null && settings != null)
{
<table class="table table-borderless">
@foreach (Profile profile in profiles)

View File

@ -153,7 +153,7 @@ namespace Oqtane.Services
public string GetSetting(Dictionary<string, string> settings, string settingName, string defaultValue)
{
string value = defaultValue;
if (settings.ContainsKey(settingName))
if (settings != null && settings.ContainsKey(settingName))
{
value = settings[settingName];
}
@ -162,6 +162,10 @@ namespace Oqtane.Services
public Dictionary<string, string> SetSetting(Dictionary<string, string> settings, string settingName, string settingValue)
{
if (settings == null)
{
settings = new Dictionary<string, string>();
}
if (settings.ContainsKey(settingName))
{
settings[settingName] = settingValue;