summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2017-07-25 17:39:40 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2017-07-25 17:39:40 +0300
commit06c2f24df9929951bbe67cf5187745e25dafa13a (patch)
tree0c01b181b648d3784b0c950ec90eea6ed7ee5e4e
parent548b372af2cf871541e2d3ceb2ca84bd670dc27b (diff)
MAINT-7636 Crash in LLPanelClassifiedInfo::sendClickMessage(..)
-rw-r--r--indra/newview/llpanelclassified.cpp57
1 files changed, 31 insertions, 26 deletions
diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp
index 5d1ae4ff10..b9b97f4cce 100644
--- a/indra/newview/llpanelclassified.cpp
+++ b/indra/newview/llpanelclassified.cpp
@@ -208,19 +208,21 @@ void LLPanelClassifiedInfo::onOpen(const LLSD& key)
LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
gGenericDispatcher.addHandler("classifiedclickthrough", &sClassifiedClickThrough);
- // While we're at it let's get the stats from the new table if that
- // capability exists.
- std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
- if (!url.empty())
+ if (gAgent.getRegion())
{
- LL_INFOS() << "Classified stat request via capability" << LL_ENDL;
- LLSD body;
- LLUUID classifiedId = getClassifiedId();
- body["classified_id"] = classifiedId;
- LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body,
- boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, classifiedId, _1));
+ // While we're at it let's get the stats from the new table if that
+ // capability exists.
+ std::string url = gAgent.getRegion()->getCapability("SearchStatRequest");
+ if (!url.empty())
+ {
+ LL_INFOS() << "Classified stat request via capability" << LL_ENDL;
+ LLSD body;
+ LLUUID classifiedId = getClassifiedId();
+ body["classified_id"] = classifiedId;
+ LLCoreHttpUtil::HttpCoroutineAdapter::callbackHttpPost(url, body,
+ boost::bind(&LLPanelClassifiedInfo::handleSearchStatResponse, classifiedId, _1));
+ }
}
-
// Update classified click stats.
// *TODO: Should we do this when opening not from search?
sendClickMessage("profile");
@@ -540,21 +542,24 @@ void LLPanelClassifiedInfo::sendClickMessage(
const LLVector3d& global_pos,
const std::string& sim_name)
{
- // You're allowed to click on your own ads to reassure yourself
- // that the system is working.
- LLSD body;
- body["type"] = type;
- body["from_search"] = from_search;
- body["classified_id"] = classified_id;
- body["parcel_id"] = parcel_id;
- body["dest_pos_global"] = global_pos.getValue();
- body["region_name"] = sim_name;
-
- std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
- LL_INFOS() << "Sending click msg via capability (url=" << url << ")" << LL_ENDL;
- LL_INFOS() << "body: [" << body << "]" << LL_ENDL;
- LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body,
- "SearchStatTracking Click report sent.", "SearchStatTracking Click report NOT sent.");
+ if (gAgent.getRegion())
+ {
+ // You're allowed to click on your own ads to reassure yourself
+ // that the system is working.
+ LLSD body;
+ body["type"] = type;
+ body["from_search"] = from_search;
+ body["classified_id"] = classified_id;
+ body["parcel_id"] = parcel_id;
+ body["dest_pos_global"] = global_pos.getValue();
+ body["region_name"] = sim_name;
+
+ std::string url = gAgent.getRegion()->getCapability("SearchStatTracking");
+ LL_INFOS() << "Sending click msg via capability (url=" << url << ")" << LL_ENDL;
+ LL_INFOS() << "body: [" << body << "]" << LL_ENDL;
+ LLCoreHttpUtil::HttpCoroutineAdapter::messageHttpPost(url, body,
+ "SearchStatTracking Click report sent.", "SearchStatTracking Click report NOT sent.");
+ }
}
void LLPanelClassifiedInfo::sendClickMessage(const std::string& type)