Skip to content

Commit

Permalink
fix(connector): otherEnd should return undefined if not connected
Browse files Browse the repository at this point in the history
  • Loading branch information
arlac77 committed Jan 11, 2016
1 parent 40dfa37 commit 3bd8043
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/connector-mixin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ const connectorMixin = (superclass) => class extends superclass {

/**
* delivers the other end of the connection chain
* @return undefined if not connected at all
*/
get otherEnd() {
let c = this;

while (c.isConnected) {
c = c.connected;
}
return c;
return c === this ? undefined : c;
}

/**
Expand Down

0 comments on commit 3bd8043

Please sign in to comment.