Added null check for plugin settings.
This commit is contained in:
parent
23ab4f593d
commit
6ec420bdb9
1 changed files with 12 additions and 9 deletions
|
|
@ -101,17 +101,20 @@ namespace Observatory.PluginManagement
|
||||||
{
|
{
|
||||||
var settingNames = new Dictionary<PropertyInfo, string>();
|
var settingNames = new Dictionary<PropertyInfo, string>();
|
||||||
|
|
||||||
var properties = settings.GetType().GetProperties();
|
if (settings != null)
|
||||||
foreach (var property in properties)
|
|
||||||
{
|
{
|
||||||
var attrib = property.GetCustomAttribute<Framework.SettingDisplayName>();
|
var properties = settings.GetType().GetProperties();
|
||||||
if (attrib == null)
|
foreach (var property in properties)
|
||||||
{
|
{
|
||||||
settingNames.Add(property, property.Name);
|
var attrib = property.GetCustomAttribute<Framework.SettingDisplayName>();
|
||||||
}
|
if (attrib == null)
|
||||||
else
|
{
|
||||||
{
|
settingNames.Add(property, property.Name);
|
||||||
settingNames.Add(property, attrib.DisplayName);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
settingNames.Add(property, attrib.DisplayName);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return settingNames;
|
return settingNames;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue