From bdedaf58726dd1c2565766fddd5f3795586f4054 Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Thu, 21 Jan 2021 23:13:44 +0200
Subject: [PATCH] SL-14728 Im session without id should be closable

---
 indra/newview/llfloaterdeleteprefpreset.cpp | 13 +++++++++++--
 indra/newview/llfloaterimsession.cpp        |  1 -
 indra/newview/llfloaterloadprefpreset.cpp   | 14 +++++++++++---
 3 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp
index 0765756b433..819b2bcee22 100644
--- a/indra/newview/llfloaterdeleteprefpreset.cpp
+++ b/indra/newview/llfloaterdeleteprefpreset.cpp
@@ -59,8 +59,17 @@ BOOL LLFloaterDeletePrefPreset::postBuild()
 void LLFloaterDeletePrefPreset::onOpen(const LLSD& key)
 {
 	mSubdirectory = key.asString();
-	std::string floater_title = getString(std::string("title_") + mSubdirectory);
-	setTitle(floater_title);
+	std::string title_type = std::string("title_") + mSubdirectory;
+    if (hasString(title_type))
+    {
+        std::string floater_title = getString(title_type);
+        setTitle(floater_title);
+    }
+    else
+    {
+        LL_WARNS() << title_type << " not found" << LL_ENDL;
+        setTitle(title_type);
+    }
 
 	LLComboBox* combo = getChild<LLComboBox>("preset_combo");
 	EDefaultOptions option = DEFAULT_HIDE;
diff --git a/indra/newview/llfloaterimsession.cpp b/indra/newview/llfloaterimsession.cpp
index a4ab1af9a80..48e2b8dc140 100644
--- a/indra/newview/llfloaterimsession.cpp
+++ b/indra/newview/llfloaterimsession.cpp
@@ -160,7 +160,6 @@ void LLFloaterIMSession::onClickCloseBtn(bool)
 	else
 	{
 		LL_WARNS() << "Empty session with id: " << (mSessionID.asString()) << LL_ENDL;
-		return;
 	}
 
 	LLFloaterIMSessionTab::onClickCloseBtn();
diff --git a/indra/newview/llfloaterloadprefpreset.cpp b/indra/newview/llfloaterloadprefpreset.cpp
index f89daf3e04a..8ed76b1df4a 100644
--- a/indra/newview/llfloaterloadprefpreset.cpp
+++ b/indra/newview/llfloaterloadprefpreset.cpp
@@ -58,9 +58,17 @@ BOOL LLFloaterLoadPrefPreset::postBuild()
 void LLFloaterLoadPrefPreset::onOpen(const LLSD& key)
 {
 	mSubdirectory = key.asString();
-	std::string floater_title = getString(std::string("title_") + mSubdirectory);
-
-	setTitle(floater_title);
+    std::string title_type = std::string("title_") + mSubdirectory;
+    if (hasString(title_type))
+    {
+        std::string floater_title = getString(title_type);
+        setTitle(floater_title);
+    }
+    else
+    {
+        LL_WARNS() << title_type << " not found" << LL_ENDL;
+        setTitle(title_type);
+    }
 
 	LLComboBox* combo = getChild<LLComboBox>("preset_combo");
 
-- 
GitLab