Remove exception if no config exists
This commit is contained in:
parent
6e4348d0d5
commit
3e73be2048
1 changed files with 1 additions and 4 deletions
|
@ -51,10 +51,7 @@ namespace Noikoio.RegexBot
|
||||||
protected object GetConfig(ulong guildId)
|
protected object GetConfig(ulong guildId)
|
||||||
{
|
{
|
||||||
var sc = RegexBot.Config.Servers.FirstOrDefault(g => g.Id == guildId);
|
var sc = RegexBot.Config.Servers.FirstOrDefault(g => g.Id == guildId);
|
||||||
if (sc == null)
|
if (sc == null) return null;
|
||||||
{
|
|
||||||
throw new ArgumentException("There is no known configuration associated with the given Guild ID.");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sc.ModuleConfigs.TryGetValue(this, out var item)) return item;
|
if (sc.ModuleConfigs.TryGetValue(this, out var item)) return item;
|
||||||
else return null;
|
else return null;
|
||||||
|
|
Loading…
Reference in a new issue