Skip to content

Commit ef68b40

Browse files
dgirardijorgeluisrocha
authored andcommitted
Debugging module: do not force ad in mocked bid responses (prebid#9059)
1 parent 6060cb5 commit ef68b40

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/debugging/bidInterceptor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Object.assign(BidInterceptor.prototype, {
126126
Object.entries(ref).forEach(([key, val]) => {
127127
if (typeof val === 'function') {
128128
result[key] = val(...args);
129-
} else if (typeof val === 'object') {
129+
} else if (val != null && typeof val === 'object') {
130130
result[key] = replFn({args, ref: val})
131131
} else {
132132
result[key] = val;
@@ -138,7 +138,7 @@ Object.assign(BidInterceptor.prototype, {
138138
return (bid, ...args) => {
139139
const response = this.responseDefaults(bid);
140140
mergeDeep(response, replFn({args: [bid, ...args]}));
141-
if (!response.ad) {
141+
if (!response.hasOwnProperty('ad') && !response.hasOwnProperty('adUrl')) {
142142
response.ad = this.defaultAd(bid, response);
143143
}
144144
response.isDebug = true;

0 commit comments

Comments
 (0)