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.
This commit is contained in:
swjain23
2019-12-18 11:40:20 -08:00
committed by Karl Burtram
parent 746b4d7815
commit e181cf2fcd

View File

@@ -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);
}