diff --git a/streaming.go b/streaming.go index 41ffe8d..6df8148 100644 --- a/streaming.go +++ b/streaming.go @@ -94,7 +94,7 @@ func (c *Client) streaming(ctx context.Context, p string, tag string) (chan Even if err == nil { req.Header.Set("Authorization", "Bearer "+c.config.AccessToken) resp, err = c.Do(req) - if resp.StatusCode != 200 { + if resp != nil && resp.StatusCode != 200 { err = fmt.Errorf("bad request: %v", resp.Status) } }