diff --git a/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts b/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts index abab573f18c1..91ee59bdd0bc 100644 --- a/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts +++ b/extensions/sql-database-projects/src/dialogs/createProjectFromDatabaseDialog.ts @@ -51,7 +51,9 @@ export class CreateProjectFromDatabaseDialog { this.dialog.cancelButton.label = constants.cancelButtonText; let connected = false; - if (this.profile) { + + // make sure the connection profile passed in has sufficient information to attempt to connect + if (this.profile && this.profile?.serverName) { const connections = await getAzdataApi()!.connection.getConnections(true); connected = !!connections.find(c => c.connectionId === this.profile!.id);