Skip to content

Commit

Permalink
bake: check printer before printing warnings
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
(cherry picked from commit dbaecd4)
  • Loading branch information
crazy-max committed Jul 16, 2024
1 parent 10c9ff9 commit 00987b1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion commands/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ func runBake(ctx context.Context, dockerCli command.Cli, targets []string, in ba
printer, err = progress.NewPrinter(ctx2, os.Stderr, progressMode,
progress.WithDesc(progressTextDesc, progressConsoleDesc),
progress.WithOnClose(func() {
printWarnings(os.Stderr, printer.Warnings(), progressMode)
if printer != nil {
printWarnings(os.Stderr, printer.Warnings(), progressMode)
}
}),
)
if err != nil {
Expand Down

0 comments on commit 00987b1

Please sign in to comment.