unset game if empty string is passed (#408)

This commit is contained in:
Brian Tanner
2016-06-03 15:16:51 -04:00
committed by abal
parent 627bbaf4ec
commit 2ac679c169
2 changed files with 6 additions and 0 deletions

View File

@@ -1407,6 +1407,9 @@ var InternalClient = (function () {
this.idleStatus = this.idleStatus || null; //undefined
}
// convert undefined and empty string to null
if (typeof game === "string" && !game.length) game = null;
this.game = game === null ? null : !game ? this.game || null : typeof game === "string" ? { name: game } : game;
var packet = {

View File

@@ -1205,6 +1205,9 @@ export default class InternalClient {
this.idleStatus = this.idleStatus || null; //undefined
}
// convert undefined and empty string to null
if (typeof game === "string" && !game.length) game = null;
this.game = game === null ? null : !game ? this.game || null : typeof game === "string" ? {name: game} : game;
var packet = {