From 11052c1bbbce82a62e22fea8c7870c90653940be Mon Sep 17 00:00:00 2001 From: Ringo Hoffmann Date: Sat, 30 Oct 2021 11:58:28 +0200 Subject: [PATCH] fix error checks in internal state wrapper --- state/internal.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/state/internal.go b/state/internal.go index 2740566..301a3ee 100644 --- a/state/internal.go +++ b/state/internal.go @@ -24,6 +24,9 @@ func (*Internal) Channel(s *discordgo.Session, id string) (c *discordgo.Channel, } if c == nil { c, err = s.Channel(id) + if err != nil { + return + } err = s.State.ChannelAdd(c) } return @@ -35,6 +38,9 @@ func (*Internal) Guild(s *discordgo.Session, id string) (g *discordgo.Guild, err } if g == nil { g, err = s.Guild(id) + if err != nil { + return + } err = s.State.GuildAdd(g) } return