From 7f90f757647cfdfc894b19f9742be8eb00f30845 Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Sun, 24 Sep 2023 02:07:06 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20crash=20on=20user.members?= =?UTF-8?q?=20without=20init=20(#1871)?= 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]