Skip to content

Commit

Permalink
fix: do not blow up if there is no socket.io
Browse files Browse the repository at this point in the history
Closes #5
  • Loading branch information
vojtajina committed Aug 24, 2013
1 parent cd589c6 commit 7aa740e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ var indexOf = function(collection, item) {

// TODO(vojta): Karma might provide this
var getCurrentTransport = function() {
// probably running in debug.html (there's no socket.io)
if (!window.parent.io) {
return null;
}

var location = window.parent.location;
return window.parent.io.sockets[location.protocol + '//' + location.host].transport.name;
};
Expand Down

0 comments on commit 7aa740e

Please sign in to comment.