From 7e1c620960c0b65136f580fa2f5ebc1855329dde Mon Sep 17 00:00:00 2001 From: Bobby Iliev Date: Fri, 27 Oct 2023 15:37:29 +0300 Subject: [PATCH] 103: Check for available profile --- src/extension.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index e4324cf..4801a0a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -43,6 +43,13 @@ export function activate(vsContext: vscode.ExtensionContext) { // Register the `Run SQL` command. let runDisposable = vscode.commands.registerCommand('materialize.run', async () => { console.log("[RunSQLCommand]", "Firing detected."); + + // Check for available profile before proceeding. + if (!context.getProfileName()) { + vscode.window.showErrorMessage('No available profile to run the query.'); + return; + } + const activeEditor = vscode.window.activeTextEditor; if (!activeEditor) { vscode.window.showErrorMessage('No active editor.');