From 09deffb5079ee52a1f8c9e89f60533743909a932 Mon Sep 17 00:00:00 2001 From: Lars Lehtonen Date: Mon, 26 Aug 2019 17:16:18 -0700 Subject: [PATCH] pkg/analyze: Fix swallowed error --- pkg/analyze/download.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/analyze/download.go b/pkg/analyze/download.go index 86465b301..ad0bc08f2 100644 --- a/pkg/analyze/download.go +++ b/pkg/analyze/download.go @@ -114,6 +114,9 @@ func extractTroubleshootBundle(reader io.Reader, destDir string) error { case tar.TypeReg: name := filepath.Join(destDir, header.Name) file, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE, os.FileMode(header.Mode)) + if err != nil { + return err + } _, err = io.Copy(file, tarReader) file.Close() if err != nil {