Skip to content

Commit

Permalink
Fixed bug where Guilds state is never populated
Browse files Browse the repository at this point in the history
  • Loading branch information
diamondburned committed Jan 20, 2020
1 parent 1c9b45e commit 7261cb2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions state/store_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,11 @@ func (s *DefaultStore) Guild(id discord.Snowflake) (*discord.Guild, error) {
func (s *DefaultStore) Guilds() ([]discord.Guild, error) {
s.mut.Lock()

if len(s.guilds) == 0 {
s.mut.Unlock()
return nil, ErrStoreNotFound
}

var gs = make([]discord.Guild, 0, len(s.guilds))
for _, g := range s.guilds {
gs = append(gs, *g)
Expand Down

0 comments on commit 7261cb2

Please sign in to comment.