SL-11660 Empty names should not be allowed

master
andreykproductengine 2019-07-29 17:44:39 +03:00
parent 04db46b088
commit b6eabbc4e3
2 changed files with 18 additions and 2 deletions

View File

@ -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);

View File

@ -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);