From 6ff34d989431d0b9f6cee40b33655bf9ce83c978 Mon Sep 17 00:00:00 2001 From: Kevin Cunnane Date: Thu, 13 Jun 2019 16:50:00 -0700 Subject: [PATCH] Fix #6022 connection dialog broken (#6023) Opening connection dialog was broken if you have a postgres connection listed in the Connections view and the extension isn't installed. The capabilities service breaks as it returns an undefined object. Added handling, so now it does show as "loading..." forever but doesn't crash --- .../platform/connection/common/connectionProfile.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/sql/platform/connection/common/connectionProfile.ts b/src/sql/platform/connection/common/connectionProfile.ts index 0b9c6ac906..76f1652fc0 100644 --- a/src/sql/platform/connection/common/connectionProfile.ts +++ b/src/sql/platform/connection/common/connectionProfile.ts @@ -44,11 +44,14 @@ export class ConnectionProfile extends ProviderConnectionInfo implements interfa this._id = model.id; this.azureTenantId = model.azureTenantId; if (this.capabilitiesService && model.providerName) { - const options = this.capabilitiesService.getCapabilities(model.providerName).connection.connectionOptions; - let appNameOption = options.find(option => option.specialValueType === ConnectionOptionSpecialType.appName); - if (appNameOption) { - let appNameKey = appNameOption.name; - this.options[appNameKey] = Constants.applicationName; + let capabilities = this.capabilitiesService.getCapabilities(model.providerName); + if (capabilities && capabilities.connection && capabilities.connection.connectionOptions) { + const options = capabilities.connection.connectionOptions; + let appNameOption = options.find(option => option.specialValueType === ConnectionOptionSpecialType.appName); + if (appNameOption) { + let appNameKey = appNameOption.name; + this.options[appNameKey] = Constants.applicationName; + } } } } else {