From 656a86a103607c8b004ebd082b982df72353a561 Mon Sep 17 00:00:00 2001 From: Lewis Sanchez <87730006+lewis-sanchez@users.noreply.github.com> Date: Tue, 21 Feb 2023 17:43:29 -0800 Subject: [PATCH] Fix empty connection name in delete connection prompt (#22001) * Fix empty name in delete connection prompt * Update src/sql/workbench/services/objectExplorer/browser/connectionTreeAction.ts Co-authored-by: Charles Gagnon --------- Co-authored-by: Charles Gagnon --- .../services/objectExplorer/browser/connectionTreeAction.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/services/objectExplorer/browser/connectionTreeAction.ts b/src/sql/workbench/services/objectExplorer/browser/connectionTreeAction.ts index ffea7b6c75..b9ca5d1e8c 100644 --- a/src/sql/workbench/services/objectExplorer/browser/connectionTreeAction.ts +++ b/src/sql/workbench/services/objectExplorer/browser/connectionTreeAction.ts @@ -290,7 +290,8 @@ export class DeleteConnectionAction extends Action { const deleteConnectionConfirmationNo = localize('deleteConnectionConfirmationNo', "No"); if (this.element instanceof ConnectionProfile) { - const modalResult = await this._dialogService.show(Severity.Warning, localize('deleteConnectionConfirmation', "Are you sure you want to delete connection '{0}'?", this.element.connectionName), + const name = this.element.connectionName || this.element.serverName; + const modalResult = await this._dialogService.show(Severity.Warning, localize('deleteConnectionConfirmation', "Are you sure you want to delete connection '{0}'?", name), [deleteConnectionConfirmationYes, deleteConnectionConfirmationNo]); if (modalResult.choice === 0) { await this._connectionManagementService.deleteConnection(this.element);