Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/deploymentrecord/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,9 @@ type NoArtifactError struct {
}

func (n *NoArtifactError) Error() string {
if n == nil || n.err == nil {
return "no artifact found"
}
Comment on lines +173 to +175
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change adds a new behavior path (n == nil or n.err == nil) but there isn't a unit test asserting that (&NoArtifactError{}).Error() returns the expected message and does not panic. Adding a small regression test would prevent future reintroductions of the nil-deref.

Copilot uses AI. Check for mistakes.
return fmt.Sprintf("no artifact found: %s", n.err.Error())
Comment on lines 172 to 176
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Error() is now nil-receiver safe, but Unwrap() still dereferences n unconditionally. If a nil *NoArtifactError is ever stored in an error interface, errors.Unwrap/Is can call Unwrap() and panic. Consider making Unwrap() return nil when the receiver is nil (and/or when n.err is nil) to keep the type fully nil-safe.

Copilot uses AI. Check for mistakes.
}

Expand Down
Loading