Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: nil pointer (#2245)

p0ny71b4c2536d97
diff --git a/server/task.go b/server/task.go
index fe30fee9b6..289f484607 100644
--- a/server/task.go
+++ b/server/task.go
@@ -522,9 +522,8 @@ func (s *Server) canPrincipalBeAssignee(ctx context.Context, principalID int, en
if principal.Role == api.Owner || principal.Role == api.DBA {
return true, nil
}
- }
- // as the policy says, the assignee group is the project owner.
- if *groupValue == api.AssigneeGroupValueProjectOwner {
+ } else if *groupValue == api.AssigneeGroupValueProjectOwner {
+ // as the policy says, the assignee group is the project owner.
member, err := s.store.GetProjectMember(ctx, &api.ProjectMemberFind{
ProjectID: &projectID,
PrincipalID: &principalID,