1
0
Fork 0
mirror of https://github.com/diamondburned/arikawa.git synced 2025-01-07 12:38:05 +00:00

State: Fixed a data race for (*DefaultStore).Messages()

This commit is contained in:
diamondburned (Forefront) 2020-05-07 12:39:47 -07:00
parent 9e33386546
commit eb09447323

View file

@ -436,7 +436,9 @@ func (s *DefaultStore) Messages(channelID discord.Snowflake) ([]discord.Message,
return nil, ErrStoreNotFound
}
return ms, nil
cp := make([]discord.Message, len(ms))
copy(cp, ms)
return cp, nil
}
func (s *DefaultStore) MaxMessages() int {