From 4fe9b07fc873fb493b1ac681961be580fd12efdd Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Sat, 23 Sep 2023 22:54:32 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20crash=20on=20user.members?= =?UTF-8?q?=20without=20init?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cannot request values from the list if we fail to initialize it in the firt place. Signed-off-by: Dominik Richter --- providers/os/resources/group.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/providers/os/resources/group.go b/providers/os/resources/group.go index 08679c05ae..731be2be1a 100644 --- a/providers/os/resources/group.go +++ b/providers/os/resources/group.go @@ -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]