Merge pull request #189 from dnf/master

Added protection against multiple callback invocation on error path
This commit is contained in:
Ciaran Jessup 2014-04-02 09:17:18 +01:00
commit edb8a4c18e
1 changed files with 4 additions and 2 deletions

View File

@ -405,8 +405,10 @@ exports.OAuth.prototype._performSecureRequest= function( oauth_token, oauth_toke
});
request.on("error", function(err) {
callbackCalled= true;
callback( err )
if(!callbackCalled) {
callbackCalled= true;
callback( err )
}
});
if( (method == "POST" || method =="PUT") && post_body != null && post_body != "" ) {