fix: possible nil pointer in actions (#5510)

This commit is contained in:
Livio Spring 2023-03-21 11:19:49 +01:00 committed by GitHub
parent 4ca50e0802
commit a6c471b2e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,6 +59,9 @@ func AppendGrantFunc(userGrants *UserGrants) func(c *actions.FieldConfig) func(c
}
func UserGrantsFromQuery(c *actions.FieldConfig, userGrants *query.UserGrants) goja.Value {
if userGrants == nil {
return c.Runtime.ToValue(nil)
}
grantList := &userGrantList{
Count: userGrants.Count,
Sequence: userGrants.Sequence,