Skip to content

Commit

Permalink
lib: fix cannot read properties of null for setRawMode
Browse files Browse the repository at this point in the history
  • Loading branch information
asaid-0 committed Dec 27, 2021
1 parent 59db172 commit 4ab5f2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tty.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ ObjectSetPrototypeOf(ReadStream, net.Socket);

ReadStream.prototype.setRawMode = function(flag) {
flag = !!flag;
const err = this._handle.setRawMode(flag);
const err = this._handle && this._handle.setRawMode(flag);
if (err) {
this.emit('error', errors.errnoException(err, 'setRawMode'));
return this;
Expand Down

0 comments on commit 4ab5f2b

Please sign in to comment.