diff options
author | Wim <wim@42.be> | 2020-08-24 23:35:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 23:35:08 +0200 |
commit | 2f506425c25504662f50f49e742529195d63ff27 (patch) | |
tree | 47170c6086cee16549a695329a478fd49174c299 /vendor/github.com/Rhymen/go-whatsapp/read.go | |
parent | e8167ee3d73c47353eea1b0bd7062bd2fc3fc127 (diff) | |
download | matterbridge-msglm-2f506425c25504662f50f49e742529195d63ff27.tar.gz matterbridge-msglm-2f506425c25504662f50f49e742529195d63ff27.tar.bz2 matterbridge-msglm-2f506425c25504662f50f49e742529195d63ff27.zip |
Update whatsapp vendor and fix a panic (#1209)
* Fix another whatsapp panic
* Update whatsapp vendor
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 { |