Skip to content

Commit

Permalink
Merge pull request #70 from SLaks/patch-1
Browse files Browse the repository at this point in the history
Ignore OAuth errors from destroyed connections
  • Loading branch information
andris9 committed Feb 15, 2014
2 parents 45eba42 + d50a757 commit d45e9cf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/client.js
Expand Up @@ -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");
}
Expand Down

0 comments on commit d45e9cf

Please sign in to comment.