braintree / braintree_node

Braintree Node.js library
https://developer.paypal.com/braintree/docs/start/overview
MIT License
335 stars 104 forks source link

Cannot call function removeEventListener of undefined #147

Closed kbariotis closed 6 years ago

kbariotis commented 6 years ago

General information

Issue description

When the OS's socket returns an error, the requestSocket (which is initialised a few lines above but never entered the socket event) variable is not defined and throws an error when try to access it.

Tested it with nock and when I disabled all network requests, the above error came up.

crookedneighbor commented 6 years ago

Seems reasonable to check for the requestSockets existence before removing the listener. We'll make this change.

Thanks for the report!

crookedneighbor commented 6 years ago

This is fixed in 2.13.0