Fix crash if bubble message isn't translated

merge-requests/6/head
Sit Melai 4 years ago
parent 91b3ff25b4
commit 673ce18e72

@ -881,12 +881,11 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText,
string::size_type startTr = ucsText.find(ucstring("{:")); string::size_type startTr = ucsText.find(ucstring("{:"));
string::size_type endOfOriginal = ucsText.find(ucstring("}@{")); string::size_type endOfOriginal = ucsText.find(ucstring("}@{"));
if (startTr != string::npos && endOfOriginal != string::npos) {
string lang = toUpper(ucsText.substr(startTr+2, 2)).toString(); string lang = toUpper(ucsText.substr(startTr+2, 2)).toString();
CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + lang + ":INVERSE_DISPLAY", false); CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + lang + ":INVERSE_DISPLAY", false);
bool inverse = node->getValueBool(); bool inverse = node->getValueBool();
if (endOfOriginal != string::npos)
{
if (!inverse) if (!inverse)
{ {
pos = endOfOriginal+4; pos = endOfOriginal+4;

Loading…
Cancel
Save