Skip to content

Commit

Permalink
Fix return of nil alertErrors
Browse files Browse the repository at this point in the history
Fixes two cases where nil alert errors were being returned rather than
the underlying error. Calling methods on these nil alert errors can lead
to panics.

Signed-off-by: Daniel Mangum <georgedanielmangum@gmail.com>
  • Loading branch information
hasheddan committed Jul 11, 2023
1 parent b905606 commit 7307f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func (c *Conn) readAndBuffer(ctx context.Context) error {
return e
}
} else if err != nil {
return e
return err
}
}
if hasHandshake {
Expand Down Expand Up @@ -650,7 +650,7 @@ func (c *Conn) handleQueuedPackets(ctx context.Context) error {
return e
}
} else if err != nil {
return e
return err
}
}
return nil
Expand Down

0 comments on commit 7307f62

Please sign in to comment.