hook: check for null object before introspection

This commit is contained in:
wpetit 2022-09-21 11:33:58 +02:00
parent b28d9f9e69
commit 9c79307ef9
1 changed files with 5 additions and 0 deletions

View File

@ -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 {