Skip to content

Commit

Permalink
🐛 fix crash on user.members without init
Browse files Browse the repository at this point in the history
Cannot request values from the list if we fail to initialize it in the firt place.

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Sep 24, 2023
1 parent 71b7530 commit 4fe9b07
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/os/resources/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ func (x *mqlGroup) members() ([]interface{}, error) {
}
users := raw.(*mqlUsers)

if err := users.refreshCache(nil); err != nil {
return nil, err
}

res := make([]interface{}, len(x.membersArr))
for i, name := range x.membersArr {
res[i] = users.usersByName[name]
Expand Down

0 comments on commit 4fe9b07

Please sign in to comment.