From d3e1fa379d6d575a9fc1b5846beaf63552e9a243 Mon Sep 17 00:00:00 2001 From: Robin Wiersig Date: Thu, 27 Jan 2022 13:37:52 +0100 Subject: [PATCH] rework of the if-condition --- uasc/secure_channel.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/uasc/secure_channel.go b/uasc/secure_channel.go index 0e3822bf..4f3d0ddd 100644 --- a/uasc/secure_channel.go +++ b/uasc/secure_channel.go @@ -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