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 @@ -1312,7 +1312,8 @@ func (q *FakeQuerier) DeleteOAuth2ProviderAppTokensByAppAndUserID(_ context.Cont
1312
1312
keyIdx := slices .IndexFunc (q .apiKeys , func (key database.APIKey ) bool {
1313
1313
return key .ID == token .APIKeyID
1314
1314
})
1315
- if q .oauth2ProviderAppSecrets [secretIdx ].AppID == arg .AppID && q .apiKeys [keyIdx ].UserID == arg .UserID {
1315
+ if secretIdx != - 1 && q .oauth2ProviderAppSecrets [secretIdx ].AppID == arg .AppID &&
1316
+ keyIdx != - 1 && q .apiKeys [keyIdx ].UserID == arg .UserID {
1316
1317
keyIDsToDelete = append (keyIDsToDelete , token .APIKeyID )
1317
1318
} else {
1318
1319
tokens = append (tokens , token )
@@ -2351,7 +2352,7 @@ func (q *FakeQuerier) GetOAuth2ProviderAppsByUserID(_ context.Context, userID uu
2351
2352
keyIdx := slices .IndexFunc (q .apiKeys , func (key database.APIKey ) bool {
2352
2353
return key .ID == token .APIKeyID
2353
2354
})
2354
- if q .apiKeys [keyIdx ].UserID == userID {
2355
+ if keyIdx != - 1 && q .apiKeys [keyIdx ].UserID == userID {
2355
2356
tokens = append (tokens , token )
2356
2357
}
2357
2358
}
You can’t perform that action at this time.
0 commit comments