From f4e9ac0f35bd384dbdff16212f26f5a72fb1da38 Mon Sep 17 00:00:00 2001 From: Tyler James Leonhardt Date: Mon, 3 Jun 2024 06:39:12 -0700 Subject: [PATCH] Handle when `item` is undefined (#214107) Fixes https://github.com/microsoft/vscode/issues/213363 --- .../contrib/terminal/browser/terminalRunRecentQuickPick.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.ts b/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.ts index a17b660a13c..b795f91f201 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalRunRecentQuickPick.ts @@ -269,6 +269,9 @@ export async function showRunRecentQuickPick( return; } const [item] = quickPick.activeItems; + if (!item) { + return; + } if ('command' in item && item.command && item.command.marker) { if (!terminalScrollStateSaved) { xterm.markTracker.saveScrollState();