diff --git a/src/main/desktop-shell-menu.ts b/src/main/desktop-shell-menu.ts index 92653847..9e4de115 100644 --- a/src/main/desktop-shell-menu.ts +++ b/src/main/desktop-shell-menu.ts @@ -67,8 +67,9 @@ export function createDesktopShellMenu(deps: DesktopShellMenuDependencies) { const result = await dialog.showOpenDialog({ properties: ["openDirectory"], }); - if (result.canceled || result.filePaths.length === 0) return; - shell.openPath(result.filePaths[0] ?? ""); + const targetPath = result.filePaths[0]; + if (result.canceled || !targetPath) return; + shell.openPath(targetPath); }, }, { type: "separator" },