check response

This commit is contained in:
Yasuhiro Matsumoto 2017-04-17 23:36:21 +09:00
parent e7f2469bc0
commit 0579b31633

View File

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