diff options
| author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-11-29 17:17:28 +0200 | 
|---|---|---|
| committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2016-11-29 17:17:28 +0200 | 
| commit | 6204b7f1edb003ec93ea51c12acf28d6a5a28549 (patch) | |
| tree | e45715dfdf809b1875554a5649a18f0392c3bc30 /indra/newview | |
| parent | b40ac4325cb234a05abcf43842b82669d76603d0 (diff) | |
MAINT-6967 FIXED Crash in LLFloaterAvatarPicker::find()
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llfloateravatarpicker.cpp | 56 | 
1 files changed, 29 insertions, 27 deletions
| diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index aa7bfbfdb7..c394eb815b 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -502,37 +502,39 @@ void LLFloaterAvatarPicker::find()  	url.reserve(128); // avoid a memory allocation or two  	LLViewerRegion* region = gAgent.getRegion(); -	url = region->getCapability("AvatarPickerSearch"); -	// Prefer use of capabilities to search on both SLID and display name -	if (!url.empty()) +	if(region)  	{ -		// capability urls don't end in '/', but we need one to parse -		// query parameters correctly -		if (url.size() > 0 && url[url.size()-1] != '/') +		url = region->getCapability("AvatarPickerSearch"); +		// Prefer use of capabilities to search on both SLID and display name +		if (!url.empty())  		{ -			url += "/"; -		} -		url += "?page_size=100&names="; -		std::replace(text.begin(), text.end(), '.', ' '); -		url += LLURI::escape(text); -		LL_INFOS() << "avatar picker " << url << LL_ENDL; +			// capability urls don't end in '/', but we need one to parse +			// query parameters correctly +			if (url.size() > 0 && url[url.size()-1] != '/') +			{ +				url += "/"; +			} +			url += "?page_size=100&names="; +			std::replace(text.begin(), text.end(), '.', ' '); +			url += LLURI::escape(text); +			LL_INFOS() << "avatar picker " << url << LL_ENDL; -        LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro", -            boost::bind(&LLFloaterAvatarPicker::findCoro, url, mQueryID, getKey().asString())); -	} -	else -	{ -		LLMessageSystem* msg = gMessageSystem; -		msg->newMessage("AvatarPickerRequest"); -		msg->nextBlock("AgentData"); -		msg->addUUID("AgentID", gAgent.getID()); -		msg->addUUID("SessionID", gAgent.getSessionID()); -		msg->addUUID("QueryID", mQueryID);	// not used right now -		msg->nextBlock("Data"); -		msg->addString("Name", text); -		gAgent.sendReliableMessage(); +            LLCoros::instance().launch("LLFloaterAvatarPicker::findCoro", +                boost::bind(&LLFloaterAvatarPicker::findCoro, url, mQueryID, getKey().asString())); +		} +		else +		{ +			LLMessageSystem* msg = gMessageSystem; +			msg->newMessage("AvatarPickerRequest"); +			msg->nextBlock("AgentData"); +			msg->addUUID("AgentID", gAgent.getID()); +			msg->addUUID("SessionID", gAgent.getSessionID()); +			msg->addUUID("QueryID", mQueryID);	// not used right now +			msg->nextBlock("Data"); +			msg->addString("Name", text); +			gAgent.sendReliableMessage(); +		}  	} -  	getChild<LLScrollListCtrl>("SearchResults")->deleteAllItems();  	getChild<LLScrollListCtrl>("SearchResults")->setCommentText(getString("searching")); | 
