From 205b2282c7417d56433540fb4ee5df195545f9d2 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Wed, 23 Apr 2025 18:09:11 +0300 Subject: #3920 LLPanel::getString crash Make sure new floater can launch wihtout a key. It isn't supposed to be launched wihtout a key, but there are some ways to do that intentionally. --- indra/newview/llfloaternewfeaturenotification.cpp | 26 ++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'indra/newview/llfloaternewfeaturenotification.cpp') diff --git a/indra/newview/llfloaternewfeaturenotification.cpp b/indra/newview/llfloaternewfeaturenotification.cpp index 369727ff1e..1badcdd3d9 100644 --- a/indra/newview/llfloaternewfeaturenotification.cpp +++ b/indra/newview/llfloaternewfeaturenotification.cpp @@ -43,12 +43,28 @@ bool LLFloaterNewFeatureNotification::postBuild() setCanDrag(false); getChild("close_btn")->setCommitCallback(boost::bind(&LLFloaterNewFeatureNotification::onCloseBtn, this)); - const std::string title_txt = "title_txt"; - const std::string dsc_txt = "description_txt"; - std::string feature = "_" + getKey().asString(); + if (getKey().isString()) + { + const std::string title_txt = "title_txt"; + const std::string dsc_txt = "description_txt"; - getChild(title_txt)->setValue(getString(title_txt + feature)); - getChild(dsc_txt)->setValue(getString(dsc_txt + feature)); + std::string feature = "_" + getKey().asString(); + if (hasString(title_txt + feature)) + { + getChild(title_txt)->setValue(getString(title_txt + feature)); + getChild(dsc_txt)->setValue(getString(dsc_txt + feature)); + } + else + { + // Show blank + LL_WARNS() << "Feature \"" << getKey().asString() << "\" not found for feature notification" << LL_ENDL; + } + } + else + { + // Show blank + LL_WARNS() << "Feature notification without a feature" << LL_ENDL; + } if (getKey().asString() == "gltf") { -- cgit v1.2.3