From b632712ea8f4cd08aa847611ffc23ff1f43b06a3 Mon Sep 17 00:00:00 2001 From: Unitech Date: Thu, 10 May 2018 19:34:16 +0200 Subject: [PATCH] fix: verify connectivity on axon socket #41 --- src/transporters/AxonTransport.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/transporters/AxonTransport.js b/src/transporters/AxonTransport.js index 0ed18f2..f23b2ce 100644 --- a/src/transporters/AxonTransport.js +++ b/src/transporters/AxonTransport.js @@ -87,7 +87,7 @@ module.exports = class AxonTransport extends Transporter { this._socket.data('*', function (data) { // Call _onMessage() with event and data as params // Apply self to use this as transport - return self._onMessage.apply(self, [ this, data ]) // eslint-disable-line + return self._onMessage.apply(self, [ this, data ]) // eslint-disable-line }) // Connect to interaction/reverse server @@ -120,7 +120,7 @@ module.exports = class AxonTransport extends Transporter { */ isConnected () { return this._socket && this._socket.connected && !this._socket.retry.waiting && - this._axon && this._axon.sock.connected && this._axon.sock.socks[0].bufferSize < 290000 + this._axon && this._axon.sock.connected && this._axon.sock.socks && this._axon.sock.socks[0] && this._axon.sock.socks[0].bufferSize < 290000 } /**