Added protection against multiple callback invocation on error path

This commit is contained in:
Don Neufeld 2014-04-01 19:05:17 -07:00
parent 324f6d69da
commit 54b958436a
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 != "" ) {