Skip to content

Commit

Permalink
avoid panic (#4841)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalnayak authored Jun 27, 2018
1 parent c8b6452 commit c2f8c0f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vault/identity_store_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1389,6 +1389,9 @@ func (i *IdentityStore) collectGroupsReverseDFS(group *identity.Group, visited m
if err != nil {
return nil, err
}
if parentGroup == nil {
continue
}
pGroups, err := i.collectGroupsReverseDFS(parentGroup, visited, groups)
if err != nil {
return nil, fmt.Errorf("failed to collect group at parent group ID %q", parentGroup.ID)
Expand Down Expand Up @@ -1418,6 +1421,9 @@ func (i *IdentityStore) collectPoliciesReverseDFS(group *identity.Group, visited
if err != nil {
return nil, err
}
if parentGroup == nil {
continue
}
parentPolicies, err := i.collectPoliciesReverseDFS(parentGroup, visited, policies)
if err != nil {
return nil, fmt.Errorf("failed to collect policies at parent group ID %q", parentGroup.ID)
Expand Down

0 comments on commit c2f8c0f

Please sign in to comment.