Skip to content

Commit

Permalink
Merge pull request #109 from noffle/unset-ref
Browse files Browse the repository at this point in the history
Ensure module-wide 'dat' reference is set.
  • Loading branch information
Karissa authored Jan 27, 2017
2 parents 15acb00 + ca7530f commit 3b500e7
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 3b500e7

Please sign in to comment.