summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsaleinfo.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-04-30 23:45:22 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-05-05 18:28:08 +0300
commitf73e0d09aabd17f778ce802353dea5c5aae007be (patch)
tree9bd26aee05f8981fb07c6af0c260bd85d0d36f19 /indra/llinventory/llsaleinfo.cpp
parent778a69c6e1783ea6c9c7ac3102990646ff2e38da (diff)
#3905 Crashes in LLInventoryModel::saveToFile
I don't expect it to fix the problem. Just making things more explicit in places of most frequent crashes.
Diffstat (limited to 'indra/llinventory/llsaleinfo.cpp')
-rw-r--r--indra/llinventory/llsaleinfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp
index 35bbc1dbb1..b4d64bb4fb 100644
--- a/indra/llinventory/llsaleinfo.cpp
+++ b/indra/llinventory/llsaleinfo.cpp
@@ -90,15 +90,20 @@ bool LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const
LLSD LLSaleInfo::asLLSD() const
{
LLSD sd;
+ asLLSD(sd);
+ return sd;
+}
+
+void LLSaleInfo::asLLSD(LLSD& sd) const
+{
const char* type = lookup(mSaleType);
if (!type)
{
LL_WARNS_ONCE() << "Unknown sale type: " << mSaleType << LL_ENDL;
type = lookup(LLSaleInfo::FS_NOT);
}
- sd["sale_type"] = type;
+ sd["sale_type"] = std::string(type);
sd["sale_price"] = mSalePrice;
- return sd;
}
bool LLSaleInfo::fromLLSD(const LLSD& sd, bool& has_perm_mask, U32& perm_mask)