mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 17:22:42 -05:00
Handle undefined error when opening connection dialog (#21980)
* handle undefined error when opening connection dialog * combine into else if * change log * update log message
This commit is contained in:
@@ -939,7 +939,11 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
// If account was not filled in from received configuration, select the first account.
|
||||
this._azureAccountDropdown.select(0);
|
||||
account = this._azureAccountList[0];
|
||||
accountName = account.key.accountId;
|
||||
if (this._azureAccountList.length > 0) {
|
||||
accountName = account.key.accountId;
|
||||
} else {
|
||||
this._logService.debug('fillInConnectionInputs: No accounts available');
|
||||
}
|
||||
}
|
||||
await this.onAzureAccountSelected();
|
||||
|
||||
@@ -959,7 +963,7 @@ export class ConnectionWidget extends lifecycle.Disposable {
|
||||
this._azureTenantId = account.properties.tenants[0].id;
|
||||
this.onAzureTenantSelected(0);
|
||||
}
|
||||
else {
|
||||
else if (accountName) {
|
||||
this._logService.error(`fillInConnectionInputs : Could not find any tenants for account ${accountName}`);
|
||||
}
|
||||
}).catch(err => this._logService.error(`Unexpected error populating initial Azure Account options : ${err}`));
|
||||
|
||||
Reference in New Issue
Block a user