From 9fddefc8fb11fbbd3bb357e11c0e2809d3868aa5 Mon Sep 17 00:00:00 2001 From: Aasim Khan Date: Wed, 8 Mar 2023 12:55:49 -0800 Subject: [PATCH] Fixing execution plan not finding provider (#22238) --- .../services/executionPlan/common/executionPlanService.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sql/workbench/services/executionPlan/common/executionPlanService.ts b/src/sql/workbench/services/executionPlan/common/executionPlanService.ts index d1be2ea18d..b8a9bd8716 100644 --- a/src/sql/workbench/services/executionPlan/common/executionPlanService.ts +++ b/src/sql/workbench/services/executionPlan/common/executionPlanService.ts @@ -33,8 +33,8 @@ export class ExecutionPlanService implements IExecutionPlanService { * @param fileExtension Execution plan file format */ public async ensureFileExtensionHandlerRegistered(fileExtension: string): Promise { - for (let providerId in Object.keys(this._capabilitiesService.providers)) { - if (this._capabilitiesService.providers[providerId].connection.supportedExecutionPlanFileExtensions?.includes(fileExtension)) { + for (let providerId of Object.keys(this._capabilitiesService.providers)) { + if (this._capabilitiesService.providers[providerId].connection?.supportedExecutionPlanFileExtensions?.includes(fileExtension)) { // We already have a provider registered that can handle this file extension so we're done return; } @@ -43,7 +43,7 @@ export class ExecutionPlanService implements IExecutionPlanService { let listener: IDisposable; await new Promise((resolve, reject) => { listener = this._capabilitiesService.onCapabilitiesRegistered(e => { - if (e.features.connection.supportedExecutionPlanFileExtensions?.includes(fileExtension)) { + if (e.features.connection?.supportedExecutionPlanFileExtensions?.includes(fileExtension)) { listener.dispose(); resolve(); }