diff --git a/lib/utils/utils.js b/lib/utils/utils.js index 4c0bfe77c..acc2ade9c 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -161,7 +161,7 @@ function downloadFile(url, dest, cb) { var file = o_fs.createWriteStream(dest); (url.substring(0, 5) === 'https' ? https : http).get(url, function (response) { if (response.statusCode !== 200) { - if (cb) cb(`Download failed, response code ${response.statusCode}`); + cb(`Download failed, response code ${response.statusCode}`); return; } response.pipe(file); @@ -170,7 +170,7 @@ function downloadFile(url, dest, cb) { }); }).on('error', function (err) { o_fs.unlink(dest); - if (cb) cb(err.message); + cb(err.message); }); }