mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-19 09:35: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);
|
||||
if (iconProvider) {
|
||||
let serverInfo: azdata.ServerInfo = this.getServerInfo(connectionProfile.id);
|
||||
let profile: interfaces.IConnectionProfile = connectionProfile.toIConnectionProfile();
|
||||
const serverInfo: azdata.ServerInfo | undefined = this.getServerInfo(connectionProfile.id);
|
||||
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 => {
|
||||
if (iconId && this._mementoObj && this._mementoContext) {
|
||||
if (!this._mementoObj.CONNECTION_ICON_ID) {
|
||||
@@ -1376,10 +1380,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
if (!profile) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let serverInfo = profile.serverInfo;
|
||||
|
||||
return serverInfo;
|
||||
return profile.serverInfo;
|
||||
}
|
||||
|
||||
public getConnectionProfileById(profileId: string): interfaces.IConnectionProfile {
|
||||
|
||||
Reference in New Issue
Block a user