1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-12-27 14:27:43 +00:00

Fixed guild folders segfault

This commit is contained in:
diamondburned 2020-08-20 21:15:21 -07:00
parent 68cfafc4c3
commit 647c854d7b

View file

@ -65,15 +65,15 @@ func (gf *GuildFolder) Name() text.Rich {
}
func (gf *GuildFolder) Servers(container cchat.ServersContainer) error {
var servers = make([]cchat.Server, len(gf.GuildIDs))
var servers = make([]cchat.Server, 0, len(gf.GuildIDs))
for i, id := range gf.GuildIDs {
for _, id := range gf.GuildIDs {
g, err := gf.session.Guild(id)
if err != nil {
continue
}
servers[i] = NewGuild(gf.session, g)
servers = append(servers, NewGuild(gf.session, g))
}
container.SetServers(servers)