From 673ce18e72778a2b7fa26aee1ca56b682a67a03d Mon Sep 17 00:00:00 2001 From: Sit Melai Date: Tue, 4 May 2021 14:14:57 +0200 Subject: [PATCH] Fix crash if bubble message isn't translated --- .../client/src/interface_v3/group_in_scene_bubble.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp index e2fca2053..91e936dc6 100644 --- a/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp +++ b/code/ryzom/client/src/interface_v3/group_in_scene_bubble.cpp @@ -881,12 +881,11 @@ void CGroupInSceneBubbleManager::chatOpen (uint32 nUID, const ucstring &ucsText, string::size_type startTr = ucsText.find(ucstring("{:")); string::size_type endOfOriginal = ucsText.find(ucstring("}@{")); - string lang = toUpper(ucsText.substr(startTr+2, 2)).toString(); - CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + lang + ":INVERSE_DISPLAY", false); - bool inverse = node->getValueBool(); + if (startTr != string::npos && endOfOriginal != string::npos) { + string lang = toUpper(ucsText.substr(startTr+2, 2)).toString(); + CCDBNodeLeaf *node= NLGUI::CDBManager::getInstance()->getDbProp("UI:SAVE:TRANSLATION:" + lang + ":INVERSE_DISPLAY", false); + bool inverse = node->getValueBool(); - if (endOfOriginal != string::npos) - { if (!inverse) { pos = endOfOriginal+4;