Permalink
Browse files

Merge pull request #70 from SLaks/patch-1

Ignore OAuth errors from destroyed connections
  • Loading branch information...
2 parents 45eba42 + d50a757 commit d45e9cf31af6f003aae793c50fc6c725273a0828 @andris9 committed Feb 15, 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 d45e9cf

Please sign in to comment.