From 08e0607a88c6e3bf1f4536854382721c72c24685 Mon Sep 17 00:00:00 2001 From: Jay Date: Mon, 22 Feb 2021 11:03:17 +0800 Subject: [PATCH] fix nil pointer --- router/api/twitch.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/router/api/twitch.go b/router/api/twitch.go index 8471171..e99ff83 100644 --- a/router/api/twitch.go +++ b/router/api/twitch.go @@ -103,6 +103,9 @@ func hasChannel(id string, c *context.Context) *model.TwitchChannel { fmt.Println("channels :: ", chs) for _, v := range chs { + if v == nil { + continue + } if v.ID == id { return v }