diff --git a/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts b/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts index dbc10ea2e26984ef35ec3afa548af5715bf86692..37873767085c080f5c8a971f4513dbb570ae06a0 100644 --- a/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts +++ b/extensions/typescript-language-features/src/commands/goToProjectConfiguration.ts @@ -75,13 +75,14 @@ async function goToProjectConfig( } catch { // noop } - if (!res || res.type !== 'response' || !res.body) { + + if (res?.type !== 'response' || !res.body) { vscode.window.showWarningMessage(localize('typescript.projectConfigCouldNotGetInfo', 'Could not determine TypeScript or JavaScript project')); return; } const { configFileName } = res.body; - if (configFileName && !isImplicitProjectConfigFile(configFileName)) { + if (!isImplicitProjectConfigFile(configFileName)) { const doc = await vscode.workspace.openTextDocument(configFileName); vscode.window.showTextDocument(doc, vscode.window.activeTextEditor ? vscode.window.activeTextEditor.viewColumn : undefined); return;