Fix create project from database for contained database (#15618)

This commit is contained in:
Sakshi Sharma
2021-06-04 11:21:18 -07:00
committed by GitHub
parent ed7521e846
commit bc766698ee

View File

@@ -228,9 +228,16 @@ export class CreateProjectFromDatabaseDialog {
// populate database dropdown with the databases for this connection
if (connectionId) {
this.sourceDatabaseDropDown!.loading = true;
const databaseValues = (await azdata.connection.listDatabases(connectionId))
// filter out system dbs
.filter(db => !constants.systemDbs.includes(db));
let databaseValues;
try {
databaseValues = (await azdata.connection.listDatabases(connectionId))
// filter out system dbs
.filter(db => !constants.systemDbs.includes(db));
} catch (e) {
// if the user doesn't have access to master, just set the database of the connection profile
databaseValues = [databaseName!];
console.warn(e);
}
this.sourceDatabaseDropDown!.values = databaseValues;
this.sourceDatabaseDropDown!.loading = false;