Skip to content

Commit

Permalink
fix(vscode): Add validation for no connections (#4155)
Browse files Browse the repository at this point in the history
Add validation for no connections
  • Loading branch information
ccastrotrejo committed Feb 8, 2024
1 parent 6f80a64 commit 5692086
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { tryGetWebviewPanel } from '../../../utils/codeless/common';
import { getWebViewHTML } from '../../../utils/codeless/getWebViewHTML';
import type { IAzureConnectorsContext } from '../azureConnectorWizard';
import { ResolutionService } from '@microsoft/parsers-logic-apps';
import { isEmptyString } from '@microsoft/utils-logic-apps';
import type { IActionContext } from '@microsoft/vscode-azext-utils';
import type { Artifacts, AzureConnectorDetails, ConnectionsData, FileDetails, Parameter } from '@microsoft/vscode-extension';
import type { WebviewPanel, WebviewOptions, WebviewPanelOptions } from 'vscode';
Expand Down Expand Up @@ -94,7 +95,8 @@ export abstract class OpenDesignerBase {
}

const parametersResolutionService = new ResolutionService(parameters, localSettings);
const resolvedConnections: ConnectionsData = parametersResolutionService.resolve(JSON.parse(connectionsData));
const parsedConnections = isEmptyString(connectionsData) ? {} : JSON.parse(connectionsData);
const resolvedConnections: ConnectionsData = parametersResolutionService.resolve(parsedConnections);

this.connectionData = resolvedConnections;
this.apiHubServiceDetails = this.getApiHubServiceDetails(azureDetails);
Expand Down

0 comments on commit 5692086

Please sign in to comment.