Skip to content

Commit

Permalink
Merge pull request #15 from webgme/14-client-user-relaunch-exception
Browse files Browse the repository at this point in the history
Fixes #14 make sure UI is not null before accessing relaunch
  • Loading branch information
kecso authored Oct 12, 2017
2 parents 89e5251 + dec65c0 commit 3a4b945
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/client/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,8 @@ define([
var i;
for (i in state.users) {
if (state.users.hasOwnProperty(i)) {
if (typeof state.users[i].UI.reLaunch === 'function') {
if (state.users[i].UI && typeof state.users[i].UI === 'object' &&
typeof state.users[i].UI.reLaunch === 'function') {
state.users[i].UI.reLaunch();
}
}
Expand Down Expand Up @@ -576,8 +577,7 @@ define([
for (i = 0; i < userIds.length; i++) {
if (state.users[userIds[i]]) {
events = [{eid: null, etype: 'complete'}];
for (j in state.users[userIds[i]].PATHS
) {
for (j in state.users[userIds[i]].PATHS) {
events.push({etype: 'unload', eid: j});
}
state.users[userIds[i]].PATTERNS = {};
Expand Down

0 comments on commit 3a4b945

Please sign in to comment.