mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-09-29 04:39:04 +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})
|
pageIcon(targetUrl, {ext: preferredExt})
|
||||||
.then(icon => {
|
.then(icon => {
|
||||||
|
if (!icon) {
|
||||||
|
throw 'Icon not found';
|
||||||
|
}
|
||||||
const outfilePath = path.join(outDir, `/icon.${icon.ext}`);
|
const outfilePath = path.join(outDir, `/icon.${icon.ext}`);
|
||||||
fs.writeFile(outfilePath, icon.data, error => {
|
fs.writeFile(outfilePath, icon.data, error => {
|
||||||
callback(error, outfilePath);
|
callback(error, outfilePath);
|
||||||
|
Loading…
Reference in New Issue
Block a user