Permalink
Browse files

Prevent error from being thrown if the clientId no longer exists

  • Loading branch information...
1 parent 957e7ac commit b5bd54f8950602f752a710c606be6754b759cab2 @goldfire committed Sep 13, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/group.js
View
5 lib/group.js
@@ -123,6 +123,11 @@ exports.initialize = function (nowjs) {
self.excludes[clientId] = false;
}
nowjs.getClient(clientId, function () {
+ // Make sure this user actually exists
+ if (!this || this && !this.user) {
+ return;
+ }
+
// Scoping note: `self` refers to the group, `this` refers to
// the new client.
self.users[this.user.clientId] = this;

0 comments on commit b5bd54f

Please sign in to comment.