Skip to content
This repository has been archived by the owner on Jul 3, 2021. It is now read-only.

Commit

Permalink
Fix: Do not assume we were given a valid array for room.usersToArray
Browse files Browse the repository at this point in the history
Fixes #139 (#140)
  • Loading branch information
mortenn authored and thedark1337 committed Sep 26, 2017
1 parent abdda00 commit d99576b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@ class Room {
let user;
const usersArray = [];

for (let i = 0; i < ids.length; i++) {
user = this.getUser(ids[i]);
if (user != null) usersArray.push(user);
if (ids) {
for (let i = 0; i < ids.length; i++) {
user = this.getUser(ids[i]);
if (user != null) usersArray.push(user);
}
}

return usersArray;
Expand Down

0 comments on commit d99576b

Please sign in to comment.