mirror of
https://github.com/go-gitea/gitea
synced 2024-12-24 03:35:55 +01:00
Verify list len before use it with IN (#3423)
This commit is contained in:
parent
b85927e488
commit
8ad92bb8a4
@ -414,8 +414,11 @@ func RemoveOrgUser(orgID, userID int64) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, err = sess.Where("user_id = ?", user.ID).In("repo_id", repoIDs).Delete(new(Access)); err != nil {
|
|
||||||
return err
|
if len(repoIDs) > 0 {
|
||||||
|
if _, err = sess.Where("user_id = ?", user.ID).In("repo_id", repoIDs).Delete(new(Access)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delete member in his/her teams.
|
// Delete member in his/her teams.
|
||||||
|
Loading…
Reference in New Issue
Block a user