Skip to content

Commit

Permalink
cli: prevent panic on operator debug
Browse files Browse the repository at this point in the history
If the API returns an error during debug bundle collection the CLI was
expanding the wrong error object, resulting in a panic since `err` is
`nil`.
  • Loading branch information
lgfa29 committed Oct 20, 2022
1 parent 67fd9ff commit 7e5eb8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion command/operator_debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -1404,7 +1404,7 @@ func writeResponseStreamOrErrorToFile[T any](obj []T, apiErr error, getWriterFn
defer writer.Close()

if apiErr != nil {
wrapped := errorWrapper{Error: err.Error()}
wrapped := errorWrapper{Error: apiErr.Error()}
return writeJSON(wrapped, writer)
}

Expand Down

0 comments on commit 7e5eb8d

Please sign in to comment.