refactor(desktop-shell-menu): drop dead '?? ""' defense in openPath

This commit is contained in:
ZacharyZhang-NY committed 2026-04-16 22:49:41 -04:00
1 parent 1ccf31f6d7
commit 4ed1e47c32
1 file changed
+3 -2
+3 -2
View File
@@ -67,8 +67,9 @@ export function createDesktopShellMenu(deps: DesktopShellMenuDependencies) {
const result = await dialog.showOpenDialog({ const result = await dialog.showOpenDialog({
properties: ["openDirectory"], properties: ["openDirectory"],
}); });
if (result.canceled || result.filePaths.length === 0) return; const targetPath = result.filePaths[0];
shell.openPath(result.filePaths[0] ?? ""); if (result.canceled || !targetPath) return;
shell.openPath(targetPath);
}, },
}, },
{ type: "separator" }, { type: "separator" },