Skip to content

Commit f0beb38

Browse files
authored
fix(app): guard session-header current() against undefined when options is empty (anomalyco#16478)
1 parent 66fcab7 commit f0beb38

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/app/src/components/session/session-header.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,12 @@ export function SessionHeader() {
303303
})
304304

305305
const canOpen = createMemo(() => platform.platform === "desktop" && !!platform.openPath && server.isLocal())
306-
const current = createMemo(() => options().find((o) => o.id === prefs.app) ?? options()[0])
306+
const current = createMemo(
307+
() =>
308+
options().find((o) => o.id === prefs.app) ??
309+
options()[0] ??
310+
({ id: "finder", label: fileManager().label, icon: fileManager().icon } as const),
311+
)
307312
const opening = createMemo(() => openRequest.app !== undefined)
308313

309314
const selectApp = (app: OpenApp) => {

0 commit comments

Comments
 (0)