diff options
Diffstat (limited to 'vendor/github.com/Rhymen/go-whatsapp/read.go')
-rw-r--r-- | vendor/github.com/Rhymen/go-whatsapp/read.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/vendor/github.com/Rhymen/go-whatsapp/read.go b/vendor/github.com/Rhymen/go-whatsapp/read.go index b870f5f8..c35f7f0e 100644 --- a/vendor/github.com/Rhymen/go-whatsapp/read.go +++ b/vendor/github.com/Rhymen/go-whatsapp/read.go @@ -5,13 +5,14 @@ import ( "crypto/sha256" "encoding/json" "fmt" + "io" + "io/ioutil" + "strings" + "github.com/Rhymen/go-whatsapp/binary" "github.com/Rhymen/go-whatsapp/crypto/cbc" "github.com/gorilla/websocket" "github.com/pkg/errors" - "io" - "io/ioutil" - "strings" ) func (wac *Conn) readPump() { @@ -27,7 +28,9 @@ func (wac *Conn) readPump() { for { readerFound := make(chan struct{}) go func() { - msgType, reader, readErr = wac.ws.conn.NextReader() + if wac.ws != nil { + msgType, reader, readErr = wac.ws.conn.NextReader() + } close(readerFound) }() select { |