From da3de4dce3a56b7c515d9384c0bffa9f9efb6d25 Mon Sep 17 00:00:00 2001 From: Andy Maloney Date: Thu, 29 Feb 2024 12:33:59 -0500 Subject: [PATCH] Fix error message to prevent nil deref --- framework/writerhelper.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/writerhelper.go b/framework/writerhelper.go index 3656e017..00b24683 100644 --- a/framework/writerhelper.go +++ b/framework/writerhelper.go @@ -49,7 +49,7 @@ func (w *WriterHelper) WriteFile(outputFileName string) (err error) { if closeErr != nil { // If we also had an error on Close(), return both errors if writeErr != nil { - err = fmt.Errorf("%s; %w", err.Error(), writeErr) + err = fmt.Errorf("%s; %w", closeErr.Error(), writeErr) } else { err = closeErr }