diff --git a/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts b/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts index bfabcb7e23..74a13a74df 100644 --- a/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts +++ b/src/sql/workbench/services/tableDesigner/browser/tableDesignerService.ts @@ -31,9 +31,8 @@ export class TableDesignerService implements ITableDesignerService { private _providers = new Map(); private async confirmBeforeExit(): Promise { - let openTableDesignerEditors = this._editorService.editors.filter(e => e instanceof TableDesignerInput); - let dirtyEditors = openTableDesignerEditors.find(e => e.isDirty()); - if (dirtyEditors) { + let dirtyTableDesigners = this._editorService.editors.filter(e => e instanceof TableDesignerInput && e.isDirty()); + if (dirtyTableDesigners.length > 0) { let result = await this._dialogService.confirm({ message: localize('TableDesigner.saveBeforeExit', 'There are unsaved changes in Table Designer that will be lost if you close the application. Do you want to close the application?'), primaryButton: localize({ key: 'TableDesigner.closeApplication', comment: ['&& denotes a mnemonic'] }, "&&Close Application"),