Permalink
Browse files

Merge pull request #72 from SLaks/patch-1

Ignore OAuth2 errors from destroyed connections
  • Loading branch information...
andris9 committed Feb 26, 2014
2 parents 4f23059 + 3311d87 commit e8ff3356f3812aebbce48e58fdfbedbc9e33fd60
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/client.js
View
@@ -608,6 +608,10 @@ SMTPClient.prototype._authenticateUser = function(){
case "XOAUTH2":
this._currentAction = this._actionAUTHComplete;
this._xoauth2.getToken((function(err, token){
+ if(this._destroyed){
+ // Nothing to do here anymore, connection already closed
+ return;
+ }
if(err){
this._onError(err, "XOAUTH2Error");
return;

0 comments on commit e8ff335

Please sign in to comment.