hook: check for null object before introspection
This commit is contained in:
parent
b28d9f9e69
commit
9c79307ef9
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue