diff --git a/src/features/Console.ts b/src/features/Console.ts index cedeb37769..cd06a4e9ea 100644 --- a/src/features/Console.ts +++ b/src/features/Console.ts @@ -211,7 +211,8 @@ export class ConsoleFeature implements IFeature { return; } - if (vscode.window.activeTerminal.name !== "PowerShell Integrated Console") { + if (vscode.window.activeTerminal && + vscode.window.activeTerminal.name !== "PowerShell Integrated Console") { this.log.write("PSIC is not active terminal. Running in active terminal using 'runSelectedText'"); await vscode.commands.executeCommand("workbench.action.terminal.runSelectedText");