From 0579b3163363dbc474bae7bbafe6fb74296e2be8 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Mon, 17 Apr 2017 23:36:21 +0900 Subject: [PATCH] check response --- streaming.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } }