From 9d646297c7232201a104a88b65b4c0786884b3c9 Mon Sep 17 00:00:00 2001 From: Andrew Woodlee Date: Fri, 15 Nov 2024 10:46:27 -0600 Subject: [PATCH] fix: check for nil Command.Hooks in ExecuteHooks [#12] --- pkg/backy/backy.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/backy/backy.go b/pkg/backy/backy.go index 54661c2..c6cc03e 100644 --- a/pkg/backy/backy.go +++ b/pkg/backy/backy.go @@ -611,6 +611,9 @@ func (c *ConfigOpts) closeHostConnections() { } func (cmd *Command) ExecuteHooks(hookType string, opts *ConfigOpts) { + if cmd.Hooks == nil { + return + } switch hookType { case "error": for _, v := range cmd.Hooks.Error {