Skip to content

Commit

Permalink
fix: ensure passed param wins over global
Browse files Browse the repository at this point in the history
  • Loading branch information
iBotPeaches committed Jun 13, 2019
1 parent 997d8db commit c7dba71
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/connector/socketio-connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export class SocketIoConnector extends Connector {
* Get socket.io module from global scope or options.
*/
getSocketIO(): any {
if (typeof io !== 'undefined') {
return io;
}

if (typeof this.options.client !== 'undefined') {
return this.options.client;
}

if (typeof io !== 'undefined') {
return io;
}

throw new Error('Socket.io client not found. Should be globally available or passed via options.client');
}

Expand Down

0 comments on commit c7dba71

Please sign in to comment.