diff --git a/vars/hook.groovy b/vars/hook.groovy index 0fa6f0d..b5e203a 100644 --- a/vars/hook.groovy +++ b/vars/hook.groovy @@ -6,6 +6,11 @@ def call(String name) { return } def hook = load(filepath) + + if (hook == null) { + error("Hook '${filepath}' seems to be null. Did you forget to add 'return this' at the end of the script ?") + } + if (hook.metaClass.respondsTo(hook, 'exec')) { hook.exec() } else {