Merge pull request #184 from iopred/patch-7
Add missing RLock in State.Channel
This commit is contained in:
commit
f64bae1371
1 changed files with 3 additions and 0 deletions
3
state.go
3
state.go
|
@ -324,6 +324,9 @@ func (s *State) Channel(channelID string) (*Channel, error) {
|
||||||
if s == nil {
|
if s == nil {
|
||||||
return nil, ErrNilState
|
return nil, ErrNilState
|
||||||
}
|
}
|
||||||
|
|
||||||
|
s.RLock()
|
||||||
|
defer s.RUnlock()
|
||||||
|
|
||||||
if c, ok := s.channelMap[channelID]; ok {
|
if c, ok := s.channelMap[channelID]; ok {
|
||||||
return c, nil
|
return c, nil
|
||||||
|
|
Loading…
Reference in a new issue