diff --git a/src/infer/inferIcon.js b/src/infer/inferIcon.js index 0d7bb2d..6700ee9 100644 --- a/src/infer/inferIcon.js +++ b/src/infer/inferIcon.js @@ -19,6 +19,9 @@ function inferIconFromUrlToPath(targetUrl, platform, outDir, callback) { pageIcon(targetUrl, {ext: preferredExt}) .then(icon => { + if (!icon) { + throw 'Icon not found'; + } const outfilePath = path.join(outDir, `/icon.${icon.ext}`); fs.writeFile(outfilePath, icon.data, error => { callback(error, outfilePath);