Use readyState because pending doesn't exist in node 8.x

This commit is contained in:
Brian M. Carlson 2020-02-20 18:01:47 -06:00
parent 2c27edf9d8
commit 81bf8b3f59

View File

@ -546,7 +546,7 @@ Client.prototype.end = function (cb) {
this._ending = true
// if we have never connected, then end is a noop, callback immediately
if (this.connection.stream.pending && !this.connection.stream.connecting) {
if (this.connection.stream.readyState === 'closed') {
if (cb) {
cb()
} else {