Skip to content

Commit

Permalink
explicitly check undefined to allow falsey values in getConfig (#4486)
Browse files Browse the repository at this point in the history
  • Loading branch information
snapwich authored and bretg committed Nov 25, 2019
1 parent 29a544c commit e964dbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,9 @@ export function newConfig() {
const configTopicSet = new Set(Object.keys(config).concat(Object.keys(currBidderConfig)));

return from(configTopicSet).reduce((memo, topic) => {
if (!currBidderConfig[topic]) {
if (typeof currBidderConfig[topic] === 'undefined') {
memo[topic] = config[topic];
} else if (!config[topic]) {
} else if (typeof config[topic] === 'undefined') {
memo[topic] = currBidderConfig[topic];
} else {
if (utils.isPlainObject(currBidderConfig[topic])) {
Expand Down
4 changes: 2 additions & 2 deletions test/spec/unit/core/adapterManager_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe('adapterManager tests', function () {
bidders: [ 'rubicon' ],
config: {
buildRequests: 'rubiconBuild',
interpretResponse: 'rubiconInterpret'
interpretResponse: null
}
});
config.setBidderConfig({
Expand Down Expand Up @@ -230,7 +230,7 @@ describe('adapterManager tests', function () {
'rubiconBuild',
{ speedy: true },
{ amazing: true },
'rubiconInterpret',
null,
'anotherBaseInterpret'
]
});
Expand Down

0 comments on commit e964dbb

Please sign in to comment.