Permalink
Browse files

Ignore OAuth errors from destroyed connections

Fixes #68
  • Loading branch information...
1 parent 45eba42 commit d50a7571b178a8e68c2feba7dbfe9f7e39104312 @SLaks SLaks committed Feb 13, 2014
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/client.js
View
@@ -584,6 +584,10 @@ SMTPClient.prototype._authenticateUser = function(){
if(typeof this.options.auth.XOAuthToken == "object" &&
typeof this.options.auth.XOAuthToken.generate == "function"){
this.options.auth.XOAuthToken.generate((function(err, XOAuthToken){
+ if(this._destroyed){
+ // Nothing to do here anymore, connection already closed
+ return;
+ }
if(err){
return this._onError(err, "XOAuthTokenError");
}

0 comments on commit d50a757

Please sign in to comment.