Added protection against multiple callback invocation on error path
This commit is contained in:
parent
324f6d69da
commit
54b958436a
|
@ -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 != "" ) {
|
||||
|
|
Loading…
Reference in New Issue