Skip to content

Commit

Permalink
fix: remove optional chainning for compatible with Nodejs12 and below (
Browse files Browse the repository at this point in the history
  • Loading branch information
bugb committed Nov 27, 2023
1 parent 286bb44 commit 02807b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/api/readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ module.exports = class BodyReadable extends Readable {
this
.on('close', function () {
signalListenerCleanup()
if (signal?.aborted) {
if (signal && signal.aborted) {
reject(signal.reason || Object.assign(new Error('The operation was aborted'), { name: 'AbortError' }))
} else {
resolve(null)
Expand Down

0 comments on commit 02807b6

Please sign in to comment.