diff --git a/lib/Client/InternalClient.js b/lib/Client/InternalClient.js index 055c88585..87e8f40b0 100644 --- a/lib/Client/InternalClient.js +++ b/lib/Client/InternalClient.js @@ -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 = { diff --git a/src/Client/InternalClient.js b/src/Client/InternalClient.js index e0f43d755..4a148d9ec 100644 --- a/src/Client/InternalClient.js +++ b/src/Client/InternalClient.js @@ -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 = {