From 4ed1e47c32b41fa7dda1da5436ccfbe7622edba8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E7=94=B5=E8=8A=BD=E8=A1=A3?= Date: Thu, 16 Apr 2026 22:49:41 -0400 Subject: [PATCH] refactor(desktop-shell-menu): drop dead '?? ""' defense in openPath --- src/main/desktop-shell-menu.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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" },