Skip to content

Commit

Permalink
Add extra nil check on ServeStale.DisableStaleWhileUpdating
Browse files Browse the repository at this point in the history
  • Loading branch information
guineveresaenger committed Dec 20, 2024
1 parent b7ad19f commit ceca12d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions internal/framework/service/rulesets/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -623,9 +623,11 @@ func toRulesetResourceModel(ctx context.Context, zoneID, accountID basetypes.Str
}

if ruleResponse.ActionParameters.ServeStale != nil {
rule.ActionParameters[0].ServeStale = []*ActionParameterServeStaleModel{{
DisableStaleWhileUpdating: types.BoolValue(*ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating),
}}
if ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating != nil {
rule.ActionParameters[0].ServeStale = []*ActionParameterServeStaleModel{{
DisableStaleWhileUpdating: types.BoolValue(*ruleResponse.ActionParameters.ServeStale.DisableStaleWhileUpdating),
}}
}
}

if ruleResponse.ActionParameters.FromList != nil {
Expand Down

0 comments on commit ceca12d

Please sign in to comment.