Skip to content

Commit

Permalink
fix(policy): add nil checking for appeal config field (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
rahmatrhd authored Aug 8, 2022
1 parent f3e51d1 commit bca19e5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions internal/store/postgres/model/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,10 @@ func (m *Policy) ToDomain() (*domain.Policy, error) {
}

var appealConfig *domain.PolicyAppealConfig
if err := json.Unmarshal(m.AppealConfig, &appealConfig); err != nil {
return nil, err
if m.AppealConfig != nil {
if err := json.Unmarshal(m.AppealConfig, &appealConfig); err != nil {
return nil, err
}
}

var iam *domain.IAMConfig
Expand Down

0 comments on commit bca19e5

Please sign in to comment.