Skip to content

Commit

Permalink
rework of the if-condition
Browse files Browse the repository at this point in the history
  • Loading branch information
dtq-two committed May 4, 2022
1 parent 790cf04 commit d3e1fa3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions uasc/secure_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ func (s *SecureChannel) readChunk() (*MessageChunk, error) {
// read a full message from the underlying conn.
b, err := s.c.Receive()

sliceIsEmpty := b != nil && len(b) == 0
if err == io.EOF || sliceIsEmpty {
if err == io.EOF || err == nil && len(b) == 0 {
return nil, io.EOF
}
// do not wrap this error since it hides conn error
Expand Down

0 comments on commit d3e1fa3

Please sign in to comment.