From 5f63f7488bc70bff56019065972546e86ac40104 Mon Sep 17 00:00:00 2001 From: Ilia Babanov Date: Wed, 23 Oct 2024 12:40:48 +0200 Subject: [PATCH] Guard against nil --- cmd/bundle/sync.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/bundle/sync.go b/cmd/bundle/sync.go index f7f32e77e..274bba0e0 100644 --- a/cmd/bundle/sync.go +++ b/cmd/bundle/sync.go @@ -38,8 +38,10 @@ func (f *syncFlags) syncOptionsFromBundle(cmd *cobra.Command, b *bundle.Bundle) case flags.OutputJSON: outputFunc = sync.JsonOutput } - opts.OutputHandler = func(ctx context.Context, c <-chan sync.Event) { - outputFunc(ctx, c, cmd.OutOrStdout()) + if outputFunc != nil { + opts.OutputHandler = func(ctx context.Context, c <-chan sync.Event) { + outputFunc(ctx, c, cmd.OutOrStdout()) + } } }