Skip to content
This repository has been archived by the owner on Aug 23, 2019. It is now read-only.

fix: one more observer edge case #248

Merged
merged 1 commit into from
Mar 15, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/protocol-muxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ module.exports = function protocolMuxer (protocols, observer) {
return
}

const handler = (protocol, _conn) => {
const handlerFunc = protocols[protocol].handlerFunc
if (handlerFunc) {
const conn = observeConn(null, protocol, _conn, observer)
handlerFunc(protocol, conn)
const handler = (protocolName, _conn) => {
const protocol = protocols[protocolName]
if (protocol) {
const handlerFunc = protocol && protocol.handlerFunc
if (handlerFunc) {
const conn = observeConn(null, protocol, _conn, observer)
handlerFunc(protocol, conn)
}
}
}

Expand Down