Add parameter checking so bitbot doesn't add a None webhook and break webhooks until restart
This commit is contained in:
parent
b3c47fab82
commit
027b9d75f8
1 changed files with 3 additions and 0 deletions
|
@ -228,6 +228,9 @@ class Module(ModuleManager.BaseModule):
|
||||||
if existing_hook:
|
if existing_hook:
|
||||||
raise utils.EventError("There's already a hook for %s" %
|
raise utils.EventError("There's already a hook for %s" %
|
||||||
hook_name)
|
hook_name)
|
||||||
|
if hook_name == None:
|
||||||
|
command = "%s%s" % (event["command_prefix"], event["command"])
|
||||||
|
raise utils.EventError("Not enough arguments (Usage: %s add <hook>)" % command)
|
||||||
|
|
||||||
all_hooks[hook_name] = {
|
all_hooks[hook_name] = {
|
||||||
"events": DEFAULT_EVENT_CATEGORIES.copy(),
|
"events": DEFAULT_EVENT_CATEGORIES.copy(),
|
||||||
|
|
Loading…
Reference in a new issue