Merge pull request #6127 from alingse/patch-1

fix call errors.Wrap with a nil value error err
This commit is contained in:
Dogan Can Bakir 2025-03-30 19:35:11 +05:30 committed by GitHub
commit 29bdb98d78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -330,7 +330,7 @@ func (w *StandardWriter) Write(event *ResultEvent) error {
data = decolorizerRegex.ReplaceAll(data, []byte("")) data = decolorizerRegex.ReplaceAll(data, []byte(""))
} }
if _, writeErr := w.outputFile.Write(data); writeErr != nil { if _, writeErr := w.outputFile.Write(data); writeErr != nil {
return errors.Wrap(err, "could not write to output") return errors.Wrap(writeErr, "could not write to output")
} }
if w.AddNewLinesOutputFile && w.json { if w.AddNewLinesOutputFile && w.json {
_, _ = w.outputFile.Write([]byte("\n")) _, _ = w.outputFile.Write([]byte("\n"))