postalsys / imapflow

IMAP Client library for EmailEngine Email API (https://emailengine.app)
https://imapflow.com
Other
350 stars 59 forks source link

Ensure `destroySoon()` is not called if is not a function #191

Closed mryraghi closed 4 months ago

mryraghi commented 4 months ago

When options.secure = true, tls is used, which exports.connect = _tls_wrap.connect;, which returns TLSSocket, which doesn't have destroySoon().

This PR simply adds some check to make sure that if destroySoon is not a function, destroy() is called instead, which is common to both tls and net.

CLAassistant commented 4 months ago

CLA assistant check
All committers have signed the CLA.

andris9 commented 4 months ago

Thanks!