0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-04-04 05:45:23 +02:00

fix nil pointer dereference

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-11-26 08:46:46 -05:00
parent 4789ef40d3
commit 36b6470548
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C

View File

@ -102,9 +102,13 @@ func (g *groupItemGroup) Sort() int {
func GetTopLevelGroupItemList(ctx context.Context, orgID int64, doer *user_model.User) []Item {
var rootItems []Item
var doerID int64
if doer != nil {
doerID = doer.ID
}
groups, err := group_model.FindGroupsByCond(ctx, &group_model.FindGroupsOptions{
ParentGroupID: 0,
ActorID: doer.ID,
ActorID: doerID,
OwnerID: orgID,
}, group_model.
AccessibleGroupCondition(doer, unit.TypeInvalid, perm.AccessModeRead))