3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-12-23 11:12:44 +01:00

Merge pull request #165 from slingamn/get_fail

fix a wide-ranging assortment of crash bugs
This commit is contained in:
Daniel Oaks 2017-11-13 22:43:24 +10:00 committed by GitHub
commit a33e83de9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,7 +43,10 @@ func (cm *ChannelManager) Get(name string) *Channel {
if err == nil { if err == nil {
cm.RLock() cm.RLock()
defer cm.RUnlock() defer cm.RUnlock()
return cm.chans[name].channel entry := cm.chans[name]
if entry != nil {
return entry.channel
}
} }
return nil return nil
} }