Skip to content

Commit 856c695

Browse files
Merge staging into feature/lambda-get-started
2 parents 410afb2 + e6adda7 commit 856c695

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/src/codewhisperer/util/authUtil.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -442,8 +442,8 @@ export class AuthUtil {
442442
* a connection if it has some CW scopes.
443443
*/
444444
findMinimalQConnection(connections: AwsConnection[]): AwsConnection | undefined {
445-
const hasQScopes = (c: AwsConnection) => codeWhispererCoreScopes.every(s => c.scopes?.includes(s))
446-
const score = (c: AwsConnection) => Number(hasQScopes(c)) * 10 + Number(c.state === 'valid')
445+
const hasQScopes = (c?: AwsConnection) => codeWhispererCoreScopes.every(s => !!c?.scopes?.includes(s))
446+
const score = (c?: AwsConnection) => Number(hasQScopes(c)) * 10 + Number(c?.state === 'valid')
447447
connections.sort(function (a, b) {
448448
return score(b) - score(a)
449449
})

0 commit comments

Comments
 (0)