Skip to content

Commit

Permalink
Merge pull request #11 from sebd71/fix_disco_crash
Browse files Browse the repository at this point in the history
Fixed nil pointer exception on disconnect event
  • Loading branch information
hesh915 authored Sep 25, 2020
2 parents 5d0dcee + 46defcb commit 83ee737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
type Options struct {
Transport string //protocol name string,websocket polling...
Query map[string]string //url的附加的参数
Header map[string][]string
Header map[string][]string
}

type Client struct {
Expand Down Expand Up @@ -169,7 +169,7 @@ func (client *Client) onPacket(decoder *decoder, packet *packet) ([]interface{},
}
args := c.GetArgs()
olen := len(args)
if olen > 0 {
if decoder != nil && olen > 0 {
packet.Data = &args
if err := decoder.DecodeData(packet); err != nil {
return nil, err
Expand Down

0 comments on commit 83ee737

Please sign in to comment.