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:
parent
68cfafc4c3
commit
647c854d7b
6
guild.go
6
guild.go
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue