Skip to content

Commit 22a471f

Browse files
authored
Merge pull request #155 from racpast/fix/quic-nil-pointer
2 parents 2b19fb7 + 560e15f commit 22a471f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

transport/quic.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,9 @@ func addPrefix(b []byte) (m []byte) {
150150
}
151151

152152
func (q *QUIC) Close() error {
153-
return q.connection().CloseWithError(DoQNoError, "")
153+
if q.connection() == nil {
154+
return nil
155+
}
156+
157+
return q.connection().CloseWithError(DoQNoError, "")
154158
}

0 commit comments

Comments
 (0)