From e34212a10b6f88789d4dc9f21717ad4d29a1b46d Mon Sep 17 00:00:00 2001 From: James Shubin Date: Fri, 13 Sep 2024 19:33:39 -0400 Subject: [PATCH] engine: resources: gzip: Check unhandled error This is probably inconsequential, but let's do it since it's not in a defer. --- engine/resources/gzip.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/resources/gzip.go b/engine/resources/gzip.go index 7083a041..5c2cb885 100644 --- a/engine/resources/gzip.go +++ b/engine/resources/gzip.go @@ -391,7 +391,9 @@ func (obj *GzipRes) CheckApply(ctx context.Context, apply bool) (bool, error) { } // NOTE: Must run this before hashing so that it includes the footer! - gzipWriter.Close() + if err := gzipWriter.Close(); err != nil { + return false, err + } sha256sum := hex.EncodeToString(hash.Sum(nil)) obj.init.Logf("wrote %d gzipped bytes", count)