fix: check for nil Command.Hooks in ExecuteHooks [#12]

This commit is contained in:
Andrew Woodlee 2024-11-15 10:46:27 -06:00
parent bf8d261cf3
commit 9d646297c7

View File

@ -611,6 +611,9 @@ func (c *ConfigOpts) closeHostConnections() {
} }
func (cmd *Command) ExecuteHooks(hookType string, opts *ConfigOpts) { func (cmd *Command) ExecuteHooks(hookType string, opts *ConfigOpts) {
if cmd.Hooks == nil {
return
}
switch hookType { switch hookType {
case "error": case "error":
for _, v := range cmd.Hooks.Error { for _, v := range cmd.Hooks.Error {