From 027b9d75f827c1add3c0beac45651a7c07b523cb Mon Sep 17 00:00:00 2001 From: Alyx Wolcott Date: Wed, 23 Sep 2020 09:25:43 -0500 Subject: [PATCH] Add parameter checking so bitbot doesn't add a None webhook and break webhooks until restart --- modules/git_webhooks/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/git_webhooks/__init__.py b/modules/git_webhooks/__init__.py index 44d9b5dc..bf412860 100644 --- a/modules/git_webhooks/__init__.py +++ b/modules/git_webhooks/__init__.py @@ -228,6 +228,9 @@ class Module(ModuleManager.BaseModule): if existing_hook: raise utils.EventError("There's already a hook for %s" % hook_name) + if hook_name == None: + command = "%s%s" % (event["command_prefix"], event["command"]) + raise utils.EventError("Not enough arguments (Usage: %s add )" % command) all_hooks[hook_name] = { "events": DEFAULT_EVENT_CATEGORIES.copy(),