From c8bcd2583201b4382848e9b6c7de55eb1e2c7156 Mon Sep 17 00:00:00 2001 From: Kim Santiago <31145923+kisantia@users.noreply.github.com> Date: Thu, 27 Feb 2020 15:37:04 -0800 Subject: [PATCH] Fix for dacfx wizard if user doesn't have access to master db (#9362) * fix for if user doesn't have access to master db * add console.warn with error --- extensions/dacpac/src/wizard/api/dacFxConfigPage.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts index 8fe5efc220..2e29917748 100644 --- a/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts +++ b/extensions/dacpac/src/wizard/api/dacFxConfigPage.ts @@ -132,7 +132,14 @@ export abstract class DacFxConfigPage extends BasePage { return false; } - let values = await this.getDatabaseValues(); + let values: string[]; + try { + values = await this.getDatabaseValues(); + } catch (e) { + // if the user doesn't have access to master, just set the database to the one the current connection is to + values = [this.model.server.databaseName]; + console.warn(e); + } // only update values and regenerate filepath if this is the first time and database isn't set yet if (this.model.database !== values[0]) {