diff --git a/pkg/hook/hook_manager.go b/pkg/hook/hook_manager.go index 5e726a83..223dd9a8 100644 --- a/pkg/hook/hook_manager.go +++ b/pkg/hook/hook_manager.go @@ -208,6 +208,10 @@ func (hm *hookManager) loadHook(hookPath string) (hook *Hook, err error) { hook.WithHookController(hookCtrl) hook.WithTmpDir(hm.TempDir()) + if hook.Config == nil { + return nil, fmt.Errorf("hook %q is marked as executable but doesn't contain config section", hook.Path) + } + hookEntry.Infof("Loaded config: %s", hook.GetConfigDescription()) return hook, nil