Skip to content

Commit e178f04

Browse files
ronagRaisinTen
authored andcommitted
fixup
1 parent 5757472 commit e178f04

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/_http_client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ function onSocketNT(req, socket, err) {
806806
socket.emit('free');
807807
} else {
808808
finished(socket.destroy(err || req[kError]), (er) => {
809-
if (er.code === 'ERR_STREAM_PREMATURE_CLOSE') {
809+
if (er?.code === 'ERR_STREAM_PREMATURE_CLOSE') {
810810
er = null;
811811
}
812812
_destroy(req, er || err);

lib/_http_incoming.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ IncomingMessage.prototype._destroy = function _destroy(err, cb) {
188188
if (this.socket && !this.socket.destroyed && this.aborted) {
189189
this.socket.destroy(err);
190190
const cleanup = finished(this.socket, (e) => {
191-
if (e.code === 'ERR_STREAM_PREMATURE_CLOSE') {
191+
if (e?.code === 'ERR_STREAM_PREMATURE_CLOSE') {
192192
e = null;
193193
}
194194
cleanup();

0 commit comments

Comments
 (0)