Fixes - TypeError: Cannot read property 'getType' of null.
Added guards against `_transport` possibly being null.
if (message.channel === '/meta/handshake') {
if (!failureInfo.transport) {
// The transport is invalid, try to negotiate again.
+ var oldTransportType = _transport ? _transport.getType() : null;
var newTransport = transports.negotiateTransport(transportTypes, version, crossDomain, url);
if (!newTransport) {
this._warn('Could not negotiate transport, client=[' + transportTypes + ']');
- _notifyTransportException(_transport.getType(), null, message.failure);
+ _notifyTransportException(oldTransportType, null, message.failure);
failureInfo.action = 'none';
} else {
- this._debug('Transport', _transport.getType(), '->', newTransport.getType());
- _notifyTransportException(_transport.getType(), newTransport.getType(), message.failure);
+ var newTransportType = newTransport.getType();
+ this._debug('Transport', oldTransportType, '->', newTransportType);
+ _notifyTransportException(oldTransportType, newTransportType, message.failure);
failureInfo.action = 'handshake';
failureInfo.transport = newTransport;
}
