mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Skip getting icon if we don't have a server info (#13017)
This commit is contained in:
@@ -573,8 +573,12 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
|
|
||||||
let iconProvider = this._iconProviders.get(connectionManagementInfo.providerId);
|
let iconProvider = this._iconProviders.get(connectionManagementInfo.providerId);
|
||||||
if (iconProvider) {
|
if (iconProvider) {
|
||||||
let serverInfo: azdata.ServerInfo = this.getServerInfo(connectionProfile.id);
|
const serverInfo: azdata.ServerInfo | undefined = this.getServerInfo(connectionProfile.id);
|
||||||
let profile: interfaces.IConnectionProfile = connectionProfile.toIConnectionProfile();
|
if (!serverInfo) {
|
||||||
|
this._logService.warn(`Could not find ServerInfo for connection ${connectionProfile.id} when updating icon`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
const profile: interfaces.IConnectionProfile = connectionProfile.toIConnectionProfile();
|
||||||
iconProvider.getConnectionIconId(profile, serverInfo).then(iconId => {
|
iconProvider.getConnectionIconId(profile, serverInfo).then(iconId => {
|
||||||
if (iconId && this._mementoObj && this._mementoContext) {
|
if (iconId && this._mementoObj && this._mementoContext) {
|
||||||
if (!this._mementoObj.CONNECTION_ICON_ID) {
|
if (!this._mementoObj.CONNECTION_ICON_ID) {
|
||||||
@@ -1376,10 +1380,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
|||||||
if (!profile) {
|
if (!profile) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
return profile.serverInfo;
|
||||||
let serverInfo = profile.serverInfo;
|
|
||||||
|
|
||||||
return serverInfo;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public getConnectionProfileById(profileId: string): interfaces.IConnectionProfile {
|
public getConnectionProfileById(profileId: string): interfaces.IConnectionProfile {
|
||||||
|
|||||||
Reference in New Issue
Block a user