mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
null check before calling isDisposable (#17959)
This commit is contained in:
@@ -116,7 +116,7 @@ export class ConnectionConfig {
|
|||||||
|
|
||||||
return this.configurationService.updateValue(CONNECTIONS_CONFIG_KEY, profiles, ConfigurationTarget.USER).then(() => {
|
return this.configurationService.updateValue(CONNECTIONS_CONFIG_KEY, profiles, ConfigurationTarget.USER).then(() => {
|
||||||
profiles.forEach(p => {
|
profiles.forEach(p => {
|
||||||
if (isDisposable(p)) {
|
if (p && isDisposable(p)) {
|
||||||
p.dispose();
|
p.dispose();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ export class ConnectionStore {
|
|||||||
// Add the profile to the saved list, taking care to clear out the password field if necessary
|
// Add the profile to the saved list, taking care to clear out the password field if necessary
|
||||||
const savedProfile = forceWritePlaintextPassword ? profile : this.getProfileWithoutPassword(profile);
|
const savedProfile = forceWritePlaintextPassword ? profile : this.getProfileWithoutPassword(profile);
|
||||||
const savedConnectionProfile = await this.saveProfileToConfig(savedProfile, matcher);
|
const savedConnectionProfile = await this.saveProfileToConfig(savedProfile, matcher);
|
||||||
if (isDisposable(savedProfile)) {
|
if (savedProfile && isDisposable(savedProfile)) {
|
||||||
savedProfile.dispose();
|
savedProfile.dispose();
|
||||||
}
|
}
|
||||||
profile.groupId = savedConnectionProfile.groupId;
|
profile.groupId = savedConnectionProfile.groupId;
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export class TreeUpdateUtils {
|
|||||||
const originalInput = tree.getInput();
|
const originalInput = tree.getInput();
|
||||||
if (treeInput !== originalInput) {
|
if (treeInput !== originalInput) {
|
||||||
return tree.setInput(treeInput).then(async () => {
|
return tree.setInput(treeInput).then(async () => {
|
||||||
if (isDisposable(originalInput)) {
|
if (originalInput && isDisposable(originalInput)) {
|
||||||
originalInput.dispose();
|
originalInput.dispose();
|
||||||
}
|
}
|
||||||
// Make sure to expand all folders that where expanded in the previous session
|
// Make sure to expand all folders that where expanded in the previous session
|
||||||
|
|||||||
Reference in New Issue
Block a user