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

Commit

Permalink
preventing options being created if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
logikaljay committed Sep 8, 2015
1 parent 38884d1 commit 894e215
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/youtube-dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var ytdl = module.exports = function(videoUrl, args, options) {
'Host': url.parse(item.url).hostname
};

if ((options || {}).start > 0) {
if (options && options.start > 0) {
headers.Range = "bytes=" + options.start + "-";
}

Expand All @@ -62,7 +62,7 @@ var ytdl = module.exports = function(videoUrl, args, options) {
});

req.on('response', function(res) {
if ((options || {}).start > 0 && res.statusCode == 416) {
if (options && options.start > 0 && res.statusCode == 416) {
// the file that is being resumed is complete.
stream.emit('end');
return;
Expand Down

0 comments on commit 894e215

Please sign in to comment.