Update whatsapp vendor and fix a panic (#1209)

* Fix another whatsapp panic

* Update whatsapp vendor
This commit is contained in:
Wim
2020-08-24 23:35:08 +02:00
committed by GitHub
parent e8167ee3d7
commit 2f506425c2
13 changed files with 228 additions and 27 deletions

View File

@@ -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 {