diff --git a/state.go b/state.go index 7993151..e3c8908 100644 --- a/state.go +++ b/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