From e181cf2fcd1531b643f26f5978921f2130155cdb Mon Sep 17 00:00:00 2001 From: swjain23 <36710109+swjain23@users.noreply.github.com> Date: Wed, 18 Dec 2019 11:40:20 -0800 Subject: [PATCH] Bug fix to return authType as undefined if displayName is not set (#8731) We noticed that if displayName is undefined this method would return the first auth type it found as getAuthTypeDisplayName() would return undefined. If the displayName is undefined, we would not have a matchingTYpe and it should be undefined. --- .../workbench/services/connection/browser/connectionWidget.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sql/workbench/services/connection/browser/connectionWidget.ts b/src/sql/workbench/services/connection/browser/connectionWidget.ts index f4b61d12db..615b839433 100644 --- a/src/sql/workbench/services/connection/browser/connectionWidget.ts +++ b/src/sql/workbench/services/connection/browser/connectionWidget.ts @@ -915,6 +915,9 @@ export class ConnectionWidget extends lifecycle.Disposable { } private getMatchingAuthType(displayName: string): AuthenticationType { + if (!displayName) { + return undefined; + } return find(ConnectionWidget._authTypes, authType => this.getAuthTypeDisplayName(authType) === displayName); }