diff options
author | Antoine du Hamel <duhamelantoine1995@gmail.com> | 2022-08-24 19:12:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-24 17:12:30 +0000 |
commit | ab89024ddc777ff888df0e239355f563e4cfa2a8 (patch) | |
tree | 22024798734d96bc4f0a64488c94a8abc99bc600 /lib/tty.js | |
parent | cb15fc56d8fb4599330e9861ee76ef4c7b5f2ab6 (diff) | |
download | node-new-ab89024ddc777ff888df0e239355f563e4cfa2a8.tar.gz |
tty: fix TypeError when stream is closed
Fixes: https://github.com/nodejs/node/issues/41330
PR-URL: https://github.com/nodejs/node/pull/43803
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Diffstat (limited to 'lib/tty.js')
-rw-r--r-- | lib/tty.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tty.js b/lib/tty.js index 33e7c26f02..3796c99cba 100644 --- a/lib/tty.js +++ b/lib/tty.js @@ -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?.setRawMode(flag); if (err) { this.emit('error', errors.errnoException(err, 'setRawMode')); return this; |