Skip to content

Commit

Permalink
simplified MediaTypePriceGranularity access
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxNode committed Nov 21, 2024
1 parent 66a7a5e commit 6f6f8e6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions endpoints/openrtb2/auction.go
Original file line number Diff line number Diff line change
Expand Up @@ -1142,19 +1142,19 @@ func validateTargeting(t *openrtb_ext.ExtRequestTargeting) error {
}
}

if mediaPriceGranularity := t.MediaTypePriceGranularity; mediaPriceGranularity != nil {
if mediaPriceGranularity.Video != nil {
if err := validatePriceGranularity(mediaPriceGranularity.Video); err != nil {
if t.MediaTypePriceGranularity != nil {
if t.MediaTypePriceGranularity.Video != nil {
if err := validatePriceGranularity(t.MediaTypePriceGranularity.Video); err != nil {
return err
}
}
if t.MediaTypePriceGranularity.Banner != nil {
if err := validatePriceGranularity(mediaPriceGranularity.Banner); err != nil {
if err := validatePriceGranularity(t.MediaTypePriceGranularity.Banner); err != nil {
return err
}
}
if mediaPriceGranularity.Native != nil {
if err := validatePriceGranularity(mediaPriceGranularity.Native); err != nil {
if t.MediaTypePriceGranularity.Native != nil {
if err := validatePriceGranularity(t.MediaTypePriceGranularity.Native); err != nil {
return err
}
}
Expand Down

0 comments on commit 6f6f8e6

Please sign in to comment.