chore: allow nil quicReconnectFunc

This commit is contained in:
Toby 2022-11-23 20:41:32 +00:00
parent 7481a859b6
commit 536fa24595

View File

@ -189,7 +189,9 @@ func (c *Client) openStreamWithReconnect() (quic.Connection, quic.Stream, error)
// Temporary error, just return
return nil, nil, err
}
c.quicReconnectFunc(err)
if c.quicReconnectFunc != nil {
c.quicReconnectFunc(err)
}
// Permanent error, need to reconnect
if err := c.connect(); err != nil {
// Still error, oops