Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add guard when writing to the socket

  • Loading branch information...
commit 6c4a2609245809116f1407ae21ee55257c8263be 1 parent 627efc1
@mscdex authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/connection.js
View
2  lib/connection.js
@@ -920,7 +920,7 @@ FTP.prototype._send = function(cmd, cb, promote) {
this._queue.push({ cmd: cmd, cb: cb });
}
var queueLen = this._queue.length;
- if (!this._curReq && queueLen) {
+ if (!this._curReq && queueLen && this._socket && this._socket.readable) {
this._curReq = this._queue.shift();
if (this._curReq.cmd === 'ABOR' && this._pasvSocket)
this._pasvSocket.aborting = true;
Please sign in to comment.
Something went wrong with that request. Please try again.