File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1300,7 +1300,8 @@ func (q *FakeQuerier) DeleteOAuth2ProviderAppTokensByAppAndUserID(_ context.Cont
1300
1300
keyIdx := slices .IndexFunc (q .apiKeys , func (key database.APIKey ) bool {
1301
1301
return key .ID == token .APIKeyID
1302
1302
})
1303
- if q .oauth2ProviderAppSecrets [secretIdx ].AppID == arg .AppID && q .apiKeys [keyIdx ].UserID == arg .UserID {
1303
+ if secretIdx != - 1 && q .oauth2ProviderAppSecrets [secretIdx ].AppID == arg .AppID &&
1304
+ keyIdx != - 1 && q .apiKeys [keyIdx ].UserID == arg .UserID {
1304
1305
keyIDsToDelete = append (keyIDsToDelete , token .APIKeyID )
1305
1306
} else {
1306
1307
tokens = append (tokens , token )
@@ -2370,7 +2371,7 @@ func (q *FakeQuerier) GetOAuth2ProviderAppsByUserID(_ context.Context, userID uu
2370
2371
keyIdx := slices .IndexFunc (q .apiKeys , func (key database.APIKey ) bool {
2371
2372
return key .ID == token .APIKeyID
2372
2373
})
2373
- if q .apiKeys [keyIdx ].UserID == userID {
2374
+ if keyIdx != - 1 && q .apiKeys [keyIdx ].UserID == userID {
2374
2375
tokens = append (tokens , token )
2375
2376
}
2376
2377
}
You can’t perform that action at this time.
0 commit comments