Skip to content

Commit

Permalink
Return an error if providerConfig is null
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoine F Moevus committed Jul 31, 2015
1 parent 0480142 commit 998eb34
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rtbkit/plugins/exchange/bidswitch_exchange_connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
Implementation of the BidSwitch exchange connector.
*/

#include <iterator> // std::begin

#include "bidswitch_exchange_connector.h"
#include "rtbkit/plugins/bid_request/openrtb_bid_request_parser.h"
#include "rtbkit/plugins/exchange/http_auction_handler.h"
Expand Down Expand Up @@ -91,7 +89,6 @@ BidSwitchExchangeConnector::init() {
return true;
}
).required().snippet();

configuration_.addField(
"adomain",
[](const Json::Value& value, CreativeInfo& data) {
Expand Down Expand Up @@ -204,6 +201,13 @@ getCampaignCompatibility(const AgentConfig & config,

auto cpinfo = std::make_shared<CampaignInfo>();

std::string exchange = exchangeName();
const char* name = exchange.c_str();
if (!config.providerConfig.isMember(name)){
result.setIncompatible(
ML::format("providerConfig.%s is null", name), includeReasons);
return result;
}
const Json::Value & pconf = config.providerConfig["bidswitch"];

try {
Expand Down

0 comments on commit 998eb34

Please sign in to comment.