mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-28 04:19:01 +00:00
Properly fail if icon is not found by pageicon
This commit is contained in:
parent
34a5a52a28
commit
d04cf0ad3a
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user