forked from pothtonswer/discordmuffin
Fix missing lock
This commit is contained in:
parent
6b73b588ba
commit
ccb504b129
1 changed files with 3 additions and 0 deletions
3
state.go
3
state.go
|
@ -233,6 +233,9 @@ func (s *State) ChannelRemove(channel *Channel) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if channel.IsPrivate {
|
if channel.IsPrivate {
|
||||||
|
s.Lock()
|
||||||
|
defer s.Unlock()
|
||||||
|
|
||||||
for i, c := range s.PrivateChannels {
|
for i, c := range s.PrivateChannels {
|
||||||
if c.ID == channel.ID {
|
if c.ID == channel.ID {
|
||||||
s.PrivateChannels = append(s.PrivateChannels[:i], s.PrivateChannels[i+1:]...)
|
s.PrivateChannels = append(s.PrivateChannels[:i], s.PrivateChannels[i+1:]...)
|
||||||
|
|
Loading…
Reference in a new issue