From 23e9f80935ebed5ac85acf93a21a180ecbeff628 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 14 Apr 2017 12:23:20 +0900 Subject: [PATCH] check error --- mastodon.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mastodon.go b/mastodon.go index 3b07728..a621def 100644 --- a/mastodon.go +++ b/mastodon.go @@ -314,8 +314,10 @@ func (c *Client) StreamingPublic(ctx context.Context) (chan Event, error) { switch name { case "update": var status Status - json.Unmarshal([]byte(token[1]), &status) - q <- &UpdateEvent{&status} + err = json.Unmarshal([]byte(token[1]), &status) + if err == nil { + q <- &UpdateEvent{&status} + } case "notification": case "delete": }