Explorar o código

Merge branch 'develop' of https://github.com/bwmarrin/Discordgo into develop

Bruce Marriner %!s(int64=9) %!d(string=hai) anos
pai
achega
df818b5931
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      state.go

+ 3 - 0
state.go

@@ -324,6 +324,9 @@ func (s *State) Channel(channelID string) (*Channel, error) {
 	if s == nil {
 		return nil, ErrNilState
 	}
+	
+	s.RLock()
+	defer s.RUnlock()
 
 	if c, ok := s.channelMap[channelID]; ok {
 		return c, nil