From b1e23fc4c3a6d651b195a6661365b475cecd7d12 Mon Sep 17 00:00:00 2001 From: Joe Hand Date: Wed, 1 Feb 2017 11:38:32 -0800 Subject: [PATCH] check key with dat.key, bug fix from dat-node 1.3.2 (#113) --- lib/download.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/download.js b/lib/download.js index d27df86..8dfa76a 100644 --- a/lib/download.js +++ b/lib/download.js @@ -13,7 +13,8 @@ module.exports = function (type, opts, dat) { // TODO: clean up this logic var resume = opts.resume || false - if (!opts.key && !resume) return ui.exit()('lib/download Key required to download') + var hasKey = dat && dat.key || opts.key + if (!hasKey && !resume) return ui.exit()('lib/download Key required to download') var network = null var stats = null