From ba574ecdd3bb8a68f95b427d2104cca3fc840b9d Mon Sep 17 00:00:00 2001 From: Jye Cusch Date: Thu, 18 Aug 2022 07:31:31 +1000 Subject: [PATCH] fix: only write the digest if it's available Sometimes an error will still return the digest, other times nil. e.g. pkg/provider/pulumi/generator.go line 154 --- pkg/cmd/stack/root.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/cmd/stack/root.go b/pkg/cmd/stack/root.go index 494aeb07c..9a2e3c320 100644 --- a/pkg/cmd/stack/root.go +++ b/pkg/cmd/stack/root.go @@ -166,8 +166,10 @@ var stackUpdateCmd = &cobra.Command{ StartMsg: "Deploying..", Runner: func(progress output.Progress) error { d, err = p.Up(progress) - // Write the digest regardless of deployment errors - writeDigest(proj.Name, s.Name, progress, d.Summary) + // Write the digest regardless of deployment errors if available + if d != nil { + writeDigest(proj.Name, s.Name, progress, d.Summary) + } return err }, @@ -224,7 +226,9 @@ nitric stack down -e aws -y`, StartMsg: "Deleting..", Runner: func(progress output.Progress) error { sum, err := p.Down(progress) - writeDigest(proj.Name, s.Name, progress, sum) + if sum != nil { + writeDigest(proj.Name, s.Name, progress, sum) + } return err }, StopMsg: "Stack",