Skip to content

Commit 44ca476

Browse files
committed
feat(authx): adds nil Dynamic struct check
Signed-off-by: Dwi Siswanto <[email protected]>
1 parent 91e1d5b commit 44ca476

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/authprovider/authx/dynamic.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ func (d *Dynamic) GetDomainAndDomainRegex() ([]string, []string) {
5252
}
5353

5454
func (d *Dynamic) UnmarshalJSON(data []byte) error {
55+
if d == nil {
56+
return errorutil.New("cannot unmarshal into nil Dynamic struct")
57+
}
58+
5559
// Use an alias type (auxiliary) to avoid a recursive call in this method.
5660
type Alias Dynamic
5761

0 commit comments

Comments
 (0)