Skip to content
Open
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 transport/quic.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,5 +150,8 @@ func addPrefix(b []byte) (m []byte) {
}

func (q *QUIC) Close() error {
if q.conn == nil {
return nil
}
Comment on lines +153 to +155
Copy link

Copilot AI Dec 18, 2025

Choose a reason for hiding this comment

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

The nil check for q.conn is correct and prevents a panic when Close is called before a connection is established. However, consider adding a test case that explicitly verifies Close can be called safely on a QUIC transport instance before any connection is established. This would ensure the bug fix is covered and prevent regression.

Copilot uses AI. Check for mistakes.
return q.connection().CloseWithError(DoQNoError, "")
}