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 @@ -1310,7 +1310,8 @@ func (q *FakeQuerier) DeleteOAuth2ProviderAppTokensByAppAndUserID(_ context.Cont
1310
1310
keyIdx := slices .IndexFunc (q .apiKeys , func (key database.APIKey ) bool {
1311
1311
return key .ID == token .APIKeyID
1312
1312
})
1313
- if q .oauth2ProviderAppSecrets [secretIdx ].AppID == arg .AppID && q .apiKeys [keyIdx ].UserID == arg .UserID {
1313
+ if secretIdx != - 1 && q .oauth2ProviderAppSecrets [secretIdx ].AppID == arg .AppID &&
1314
+ keyIdx != - 1 && q .apiKeys [keyIdx ].UserID == arg .UserID {
1314
1315
keyIDsToDelete = append (keyIDsToDelete , token .APIKeyID )
1315
1316
} else {
1316
1317
tokens = append (tokens , token )
@@ -2312,7 +2313,7 @@ func (q *FakeQuerier) GetOAuth2ProviderAppsByUserID(_ context.Context, userID uu
2312
2313
keyIdx := slices .IndexFunc (q .apiKeys , func (key database.APIKey ) bool {
2313
2314
return key .ID == token .APIKeyID
2314
2315
})
2315
- if q .apiKeys [keyIdx ].UserID == userID {
2316
+ if keyIdx != - 1 && q .apiKeys [keyIdx ].UserID == userID {
2316
2317
tokens = append (tokens , token )
2317
2318
}
2318
2319
}
You can’t perform that action at this time.
0 commit comments