Skip to content

Commit

Permalink
fix: avoid optional chaining
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Nov 3, 2023
1 parent 2aedba4 commit 87c54cb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/core/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ class Request {
} else if (util.isStream(body)) {
this.body = body

if (!this.body._readableState?.autoDestroy) {
const rState = this.body._readableState
if (!rState || !rState.autoDestroy) {
this.endHandler = function autoDestroy () {
util.destroy(this)
}
Expand Down

0 comments on commit 87c54cb

Please sign in to comment.