Skip to content
This repository has been archived by the owner on Dec 3, 2023. It is now read-only.

Commit

Permalink
Execa function may not pass stdout in callback function if run it wit…
Browse files Browse the repository at this point in the history
…h the `{ stdio: 'inherit' }` options.

Added a check for the presence of stdout in the object passed to the execa callback function.
  • Loading branch information
nlapshin committed Jul 25, 2020
1 parent 3951701 commit a85b449
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const execa = universalify.fromPromise(require('execa'))
function youtubeDl (args, options, cb) {
return execa(ytdlBinary, args, options, function done (err, output) {
if (err) return cb(err)
return cb(null, output.stdout.trim().split(/\r?\n/))
return cb(null, output.stdout ? output.stdout.trim().split(/\r?\n/) : undefined)
})
}

Expand Down

0 comments on commit a85b449

Please sign in to comment.