Skip to content

Commit

Permalink
Fix crash in onerror (#117)
Browse files Browse the repository at this point in the history
Fixes #116
  • Loading branch information
dotchev authored and alexpenev-s committed Jan 29, 2018
1 parent e4059af commit 13782a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/protocol/Connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ Connection.prototype._addListeners = function _addListeners(socket) {
socket.on('data', ondata);

function onerror(err) {
var cb = self._state.receive;
var cb = self._state && self._state.receive;
if (cb) {
self._state.receive = null; // a callback should be called only once
cb(err);
Expand Down

0 comments on commit 13782a1

Please sign in to comment.