mirror of
https://github.com/ncblakely/GiantsTools
synced 2024-12-22 07:17:22 +01:00
Fix config defaulting logic.
This commit is contained in:
parent
05490c58bc
commit
77719159d0
@ -39,13 +39,22 @@
|
||||
if (this.userConfig.ContainsKey(section))
|
||||
{
|
||||
dynamic sectionObject = this.userConfig[section];
|
||||
if (sectionObject != null)
|
||||
if (sectionObject != null && sectionObject.ContainsKey(key))
|
||||
{
|
||||
return sectionObject.ContainsKey(key) ? (string)sectionObject[key] : "";
|
||||
return (string)sectionObject[key];
|
||||
}
|
||||
}
|
||||
|
||||
return this.defaultConfig[section][key];
|
||||
if (this.defaultConfig.ContainsKey(section))
|
||||
{
|
||||
dynamic sectionObject = this.defaultConfig[section];
|
||||
if (sectionObject != null && sectionObject.ContainsKey(key))
|
||||
{
|
||||
return (string)sectionObject[key];
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
// TODO: other accessors unimplemented as we only need master server host name for now
|
||||
|
Loading…
Reference in New Issue
Block a user