diff --git a/index.js b/index.js index 69e3976c0..cbaa5da8e 100644 --- a/index.js +++ b/index.js @@ -52,7 +52,7 @@ exports.Client.prototype.getChannel = function( id ) { exports.Client.prototype.triggerEvent = function( event, args ) { - if ( !this.ready && event !== "raw" && event !== "disconnected" ) { //if we're not even loaded yet, don't try doing anything because it always ends badly! + if ( !this.ready && event !== "raw" && event !== "disconnected" && event !== "debug" ) { //if we're not even loaded yet, don't try doing anything because it always ends badly! return; } @@ -364,6 +364,8 @@ exports.Client.prototype.connectWebsocket = function( cb ) { exports.Client.prototype.logout = function( callback ) { + callback = callback || function(){}; + var self = this; Internal.XHR.logout( self.token, function( err ) {