Skip to content

Commit 6d0ddd2

Browse files
committed
John's suggestion
1 parent c7858a2 commit 6d0ddd2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/commands/webSocketTerminal.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -791,7 +791,7 @@ export class WebSocketTerminalProfileProvider implements vscode.TerminalProfileP
791791
// Get the terminal configuration. Will throw if there's an error.
792792
const terminalOpts = terminalConfigForUri(new AtelierAPI(uri), uri, true);
793793
return new vscode.TerminalProfile(terminalOpts);
794-
} else {
794+
} else if (uri == undefined) {
795795
throw new Error(
796796
"Lite Terminal requires an active server connection to InterSystems IRIS version 2023.2 or above."
797797
);

src/utils/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,8 @@ interface ConnQPItem extends vscode.QuickPickItem {
782782
* connection, that will be returned without prompting the user.
783783
*
784784
* @param minVersion Optional minimum server version to enforce, in semantic version form (20XX.Y.Z).
785+
* @returns `undefined` if there were no suitable server connections and `null` if the
786+
* user explicitly escaped from the QuickPick.
785787
*/
786788
export async function getWsServerConnection(minVersion?: string): Promise<vscode.Uri> {
787789
if (!vscode.workspace.workspaceFolders?.length) return;
@@ -811,7 +813,7 @@ export async function getWsServerConnection(minVersion?: string): Promise<vscode
811813
matchOnDetail: true,
812814
title: "Pick a server connection from the current workspace",
813815
})
814-
.then((c) => c?.uri);
816+
.then((c) => c?.uri ?? null);
815817
}
816818

817819
// ---------------------------------------------------------------------

0 commit comments

Comments
 (0)