mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
fix issue with empty connection (#5602)
This commit is contained in:
@@ -43,7 +43,7 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa
|
|||||||
this.saveProfile = model.saveProfile;
|
this.saveProfile = model.saveProfile;
|
||||||
this._id = model.id;
|
this._id = model.id;
|
||||||
this.azureTenantId = model.azureTenantId;
|
this.azureTenantId = model.azureTenantId;
|
||||||
if (this.capabilitiesService) {
|
if (this.capabilitiesService && model.providerName) {
|
||||||
const options = this.capabilitiesService.getCapabilities(model.providerName).connection.connectionOptions;
|
const options = this.capabilitiesService.getCapabilities(model.providerName).connection.connectionOptions;
|
||||||
let appNameOption = options.find(option => option.specialValueType === ConnectionOptionSpecialType.appName);
|
let appNameOption = options.find(option => option.specialValueType === ConnectionOptionSpecialType.appName);
|
||||||
if (appNameOption) {
|
if (appNameOption) {
|
||||||
|
|||||||
@@ -214,4 +214,8 @@ suite('SQL ConnectionProfileInfo tests', () => {
|
|||||||
assert.notEqual(newProfile.id, conn.id);
|
assert.notEqual(newProfile.id, conn.id);
|
||||||
assert.equal(newProfile.databaseName, 'new db');
|
assert.equal(newProfile.databaseName, 'new db');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('an empty connection profile does not cause issues', () => {
|
||||||
|
assert.doesNotThrow(() => new ConnectionProfile(capabilitiesService, {} as IConnectionProfile));
|
||||||
|
});
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user