Skip to content

Commit 5fc401e

Browse files
committed
fix: avoid Client slice field be null
1 parent 46846e9 commit 5fc401e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

client/client.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,26 @@ func (c *Client) BeforeSave(_ *pop.Connection) error {
407407
c.AllowedCORSOrigins = sqlxx.StringSliceJSONFormat{}
408408
}
409409

410+
if c.Contacts == nil {
411+
c.Contacts = sqlxx.StringSliceJSONFormat{}
412+
}
413+
414+
if c.PostLogoutRedirectURIs == nil {
415+
c.PostLogoutRedirectURIs = sqlxx.StringSliceJSONFormat{}
416+
}
417+
418+
if c.RequestURIs == nil {
419+
c.RequestURIs = sqlxx.StringSliceJSONFormat{}
420+
}
421+
422+
if c.GrantTypes == nil {
423+
c.GrantTypes = sqlxx.StringSliceJSONFormat{}
424+
}
425+
426+
if c.ResponseTypes == nil {
427+
c.ResponseTypes = sqlxx.StringSliceJSONFormat{}
428+
}
429+
410430
if c.CreatedAt.IsZero() {
411431
c.CreatedAt = time.Now()
412432
}

0 commit comments

Comments
 (0)