Fix godnames module to not add the empty string if only one option is used

0.9.1.0-post-fixes
Melanie 2019-07-27 12:12:35 +01:00
parent d6723dab37
commit 34209d2a39
1 changed files with 14 additions and 8 deletions

View File

@ -66,17 +66,23 @@ namespace OpenSim.Region.OptionalModules.ViewerSupport
m_log.Info("[GODNAMES]: Enabled"); m_log.Info("[GODNAMES]: Enabled");
m_enabled = true; m_enabled = true;
string conf_str = moduleConfig.GetString("FullNames", String.Empty); string conf_str = moduleConfig.GetString("FullNames", String.Empty);
foreach (string strl in conf_str.Split(',')) { if (conf_str != String.Empty)
string strlan = strl.Trim(" \t".ToCharArray()); {
m_log.DebugFormat("[GODNAMES]: Adding {0} as a God name", strlan); foreach (string strl in conf_str.Split(',')) {
m_fullNames.Add(strlan); string strlan = strl.Trim(" \t".ToCharArray());
m_log.DebugFormat("[GODNAMES]: Adding {0} as a God name", strlan);
m_fullNames.Add(strlan);
}
} }
conf_str = moduleConfig.GetString("Surnames", String.Empty); conf_str = moduleConfig.GetString("Surnames", String.Empty);
foreach (string strl in conf_str.Split(',')) { if (conf_str != String.Empty)
string strlan = strl.Trim(" \t".ToCharArray()); {
m_log.DebugFormat("[GODNAMES]: Adding {0} as a God last name", strlan); foreach (string strl in conf_str.Split(',')) {
m_lastNames.Add(strlan); string strlan = strl.Trim(" \t".ToCharArray());
m_log.DebugFormat("[GODNAMES]: Adding {0} as a God last name", strlan);
m_lastNames.Add(strlan);
}
} }
} }