check response

pull/24/head
Yasuhiro Matsumoto 2017-04-17 23:36:21 +09:00
parent e7f2469bc0
commit 0579b31633
1 changed files with 1 additions and 1 deletions

View File

@ -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)
}
}