diff --git a/lib/room.js b/lib/room.js index 023639c..ed2bb4f 100644 --- a/lib/room.js +++ b/lib/room.js @@ -682,6 +682,10 @@ class Room { * @returns {User[]} An Array of all DJs in the room and the current DJ. */ getDJs() { + if (this.booth.currentDJ == null || this.booth.waitingDJs == null) { + return []; + } + return this.usersToArray([this.booth.currentDJ].concat(this.booth.waitingDJs)); } @@ -690,6 +694,10 @@ class Room { * @returns {User[]} An Array of all DJs in the room that are in waitlist */ getWaitList() { + if (this.booth.waitingDJs == null) { + return []; + } + return this.usersToArray(this.booth.waitingDJs); }