Skip to content

Commit f0e823e

Browse files
author
Josh Barr
committed
check for connection in map
1 parent 533f7ac commit f0e823e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/db/db.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,12 @@ func (store *CredentialStore) GetClientWithSecret(allClients map[string]OidcClie
138138

139139
func (store *CredentialStore) GetClientWithoutSecret(allClients map[string]OidcClient, name string) (OidcClient, error) {
140140
var client OidcClient
141-
client = allClients[name]
142-
return client, nil
141+
142+
if client, ok := allClients[name]; ok {
143+
return client, nil
144+
}
145+
146+
return client, errors.New("connection not found")
143147
}
144148

145149
func (store *CredentialStore) ClientExists(name string) (bool, error) {

0 commit comments

Comments
 (0)