Skip to content

Commit e83cc05

Browse files
nerdCopterclaude
andcommitted
fix(main): continue to next icon candidate if nativeImage is empty
If a Linux icon path exists (fs.existsSync) but the file is unreadable or corrupt, nativeImage.createFromPath() returns an empty NativeImage. Returning undefined immediately skips all remaining fallback candidates. Use continue so the loop advances to the next path instead. Addresses: #615 (review) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 349dbb5 commit e83cc05

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

main.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,10 @@ function getWindowIconPath() {
7575
// and packaged (.deb) modes.
7676
if (process.platform === 'linux') {
7777
const img = nativeImage.createFromPath(iconPath);
78-
return img.isEmpty() ? undefined : img;
78+
if (!img.isEmpty()) {
79+
return img;
80+
}
81+
continue;
7982
}
8083
return iconPath;
8184
}

0 commit comments

Comments
 (0)