Skip to content

Commit e899da9

Browse files
authored
fix: split map check/create to guard nil (#781)
Signed-off-by: Chris Gianelloni <[email protected]>
1 parent 5a800b1 commit e899da9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

muxer/muxer.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ func (m *Muxer) RegisterProtocol(
160160
m.protocolReceiversMutex.Lock()
161161
if _, ok := m.protocolSenders[protocolId]; !ok {
162162
m.protocolSenders[protocolId] = make(map[ProtocolRole]chan *Segment)
163+
}
164+
if _, ok := m.protocolReceivers[protocolId]; !ok {
163165
m.protocolReceivers[protocolId] = make(map[ProtocolRole]chan *Segment)
164166
}
165167
m.protocolSenders[protocolId][protocolRole] = senderChan

0 commit comments

Comments
 (0)