Skip to content

Commit

Permalink
Ensure module-wide 'dat' reference is set.
Browse files Browse the repository at this point in the history
This is necessary, since line 118 references the module-wide 'dat'
reference, and there are two entry-points for the 'start' function.
  • Loading branch information
hackergrrl committed Jan 26, 2017
1 parent 15acb00 commit ca7530f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,11 @@ module.exports = function (type, opts, dat) {
if (!dat) Dat(opts.dir, opts, start)
else start(null, dat)

function start (err, dat) {
function start (err, theDat) {
if (err) return exit(err)

dat = theDat

debug('Download: ' + type + ' on ' + dat.key.toString('hex'))

archive = dat.archive
Expand Down

0 comments on commit ca7530f

Please sign in to comment.