Fixed bugs relating to config load

This commit is contained in:
Noikoio 2018-03-04 20:45:12 -08:00
parent 7a8a82102f
commit fe1f466b97
2 changed files with 2 additions and 2 deletions

View file

@ -59,7 +59,7 @@ namespace Noikoio.RegexBot.Module.ModTools
if (string.IsNullOrWhiteSpace(label)) throw new RuleImportException("Label cannot be blank.");
var definition = (JObject)def.Value;
string cmdinvoke = definition["command"].Value<string>();
string cmdinvoke = definition["command"]?.Value<string>();
if (string.IsNullOrWhiteSpace(cmdinvoke))
throw new RuleImportException($"{label}: 'command' value was not specified.");
if (cmdinvoke.Contains(" "))

View file

@ -7,7 +7,7 @@ namespace Noikoio.RegexBot.Module.ModTools.Commands
class ConfReload : CommandBase
{
// No configuration.
protected ConfReload(ModTools l, string label, JObject conf) : base(l, label, conf) { }
public ConfReload(ModTools l, string label, JObject conf) : base(l, label, conf) { }
// Usage: (command)
public override async Task Invoke(SocketGuild g, SocketMessage msg)