Skip to content

Commit

Permalink
fix: ensure commandSocket is set before retrieving ip address of conn…
Browse files Browse the repository at this point in the history
…ection (#222)
  • Loading branch information
techmunk committed Dec 8, 2020
1 parent db49063 commit 4cd88b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class FtpConnection extends EventEmitter {
super();
this.server = server;
this.id = uuid.v4();
this.commandSocket = options.socket;
this.log = options.log.child({id: this.id, ip: this.ip});
this.commands = new Commands(this);
this.transferType = 'binary';
Expand All @@ -24,7 +25,6 @@ class FtpConnection extends EventEmitter {

this.connector = new BaseConnector(this);

this.commandSocket = options.socket;
this.commandSocket.on('error', (err) => {
this.log.error(err, 'Client error');
this.server.emit('client-error', {connection: this, context: 'commandSocket', error: err});
Expand Down

0 comments on commit 4cd88b1

Please sign in to comment.