summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorandreykproductengine <andreykproductengine@lindenlab.com>2019-07-29 17:44:39 +0300
committerandreykproductengine <andreykproductengine@lindenlab.com>2019-07-29 17:44:39 +0300
commitb6eabbc4e3b99a07ef5d8cdd3594a97de8ff5ad3 (patch)
tree3c5f05a2880812aebdacc19b18128fa15c46fc33 /indra
parent04db46b088b8d974f10ce0b5acdd35007f4bb060 (diff)
SL-11660 Empty names should not be allowed
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloatereditextdaycycle.cpp10
-rw-r--r--indra/newview/llfloaterfixedenvironment.cpp10
2 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/llfloatereditextdaycycle.cpp b/indra/newview/llfloatereditextdaycycle.cpp
index 233c78d072..0fb7fee8cb 100644
--- a/indra/newview/llfloatereditextdaycycle.cpp
+++ b/indra/newview/llfloatereditextdaycycle.cpp
@@ -699,7 +699,15 @@ void LLFloaterEditExtDayCycle::onSaveAsCommit(const LLSD& notification, const LL
if (0 == option)
{
std::string settings_name = response["message"].asString();
- LLStringUtil::trim(settings_name);
+
+ LLInventoryObject::correctInventoryName(settings_name);
+ if (settings_name.empty())
+ {
+ // Ideally notification should disable 'OK' button if name won't fit our requirements,
+ // for now either display notification, or use some default name
+ settings_name = "Unnamed";
+ }
+
if (mCanMod)
{
doApplyCreateNewInventory(day, settings_name);
diff --git a/indra/newview/llfloaterfixedenvironment.cpp b/indra/newview/llfloaterfixedenvironment.cpp
index b1fdc2d2a5..05da640258 100644
--- a/indra/newview/llfloaterfixedenvironment.cpp
+++ b/indra/newview/llfloaterfixedenvironment.cpp
@@ -474,7 +474,15 @@ void LLFloaterFixedEnvironment::onSaveAsCommit(const LLSD& notification, const L
if (0 == option)
{
std::string settings_name = response["message"].asString();
- LLStringUtil::trim(settings_name);
+
+ LLInventoryObject::correctInventoryName(settings_name);
+ if (settings_name.empty())
+ {
+ // Ideally notification should disable 'OK' button if name won't fit our requirements,
+ // for now either display notification, or use some default name
+ settings_name = "Unnamed";
+ }
+
if (mCanMod)
{
doApplyCreateNewInventory(settings_name, settings);