From 2d41fd5ce9e2c821ea4da8a6650f445dbf48d641 Mon Sep 17 00:00:00 2001 From: Florrie Date: Tue, 26 Jun 2018 22:11:35 -0300 Subject: Hide/fix weird bug with empty downloaderArgs --- downloaders.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'downloaders.js') diff --git a/downloaders.js b/downloaders.js index 1e2a9e9..b7582a9 100644 --- a/downloaders.js +++ b/downloaders.js @@ -19,6 +19,11 @@ const copyFile = fse.copy const cachify = (identifier, baseFunction) => { return async arg => { + // If there was no argument passed (or it aws empty), nothing will work.. + if (!arg) { + throw new TypeError('Expected a downloader argument') + } + // Determine where the final file will end up. This is just a directory - // the file's own name is determined by the downloader. const cacheDir = downloaders.rootCacheDir + '/' + identifier -- cgit 1.3.0-6-gf8a5