Permalink
Browse files

fix crash

  • Loading branch information...
1 parent 9ca2739 commit 69acf71e3e260e6b749a993359b2254b35538d98 @toffaletti committed Jun 28, 2012
Showing with 4 additions and 1 deletion.
  1. +4 −1 rl-proxy.cc
View
@@ -287,7 +287,10 @@ static http_request normalize_request(http_server::request &h) {
static std::pair<bool, std::string> get_jsonp(http_server::request &h) {
auto params = h.get_uri().query_part();
auto i = params.find("callback");
- return std::make_pair(i != params.end(), i->second);
+ if (i == params.end()) {
+ return std::make_pair(false, std::string());
+ }
+ return std::make_pair(true, i->second);
}
static void make_jsonp_response(http_server::request &h, const std::string &callback) {

0 comments on commit 69acf71

Please sign in to comment.