Skip to content

Commit

Permalink
fix error checks in internal state wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Oct 30, 2021
1 parent 65f2cbe commit 11052c1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions state/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 11052c1

Please sign in to comment.