Skip to content

Commit

Permalink
Fixed panic when connectionType is not available in request (#901)
Browse files Browse the repository at this point in the history
  • Loading branch information
pm-nikhil-vaidya authored and pm-viral-vala committed Sep 26, 2024
1 parent dae441c commit 61268f3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion modules/pubmatic/openwrap/beforevalidationhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,13 @@ func (m OpenWrap) handleBeforeValidationHook(
m.metricEngine.RecordReqImpsWithContentCount(rCtx.PubIDStr, models.ContentTypeSite)
}
}
videoAdUnitCtx = adunitconfig.UpdateVideoObjectWithAdunitConfig(rCtx, imp, div, payload.BidRequest.Device.ConnectionType)

var connectionType *adcom1.ConnectionType
if payload.BidRequest.Device != nil && payload.BidRequest.Device.ConnectionType != nil {
connectionType = payload.BidRequest.Device.ConnectionType
}

videoAdUnitCtx = adunitconfig.UpdateVideoObjectWithAdunitConfig(rCtx, imp, div, connectionType)
if rCtx.Endpoint == models.EndpointAMP && m.pubFeatures.IsAmpMultiformatEnabled(rCtx.PubID) && isVideoEnabledForAMP(videoAdUnitCtx.AppliedSlotAdUnitConfig) {
//Iniitalized local imp.Video object to update macros and get mappings in case of AMP request
rCtx.AmpVideoEnabled = true
Expand Down

0 comments on commit 61268f3

Please sign in to comment.