summaryrefslogtreecommitdiff
path: root/indra/llinventory/llsaleinfo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llinventory/llsaleinfo.cpp')
-rw-r--r--indra/llinventory/llsaleinfo.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp
index 98836b178e..b4d64bb4fb 100644
--- a/indra/llinventory/llsaleinfo.cpp
+++ b/indra/llinventory/llsaleinfo.cpp
@@ -89,12 +89,23 @@ bool LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const
LLSD LLSaleInfo::asLLSD() const
{
- LLSD sd = LLSD();
- sd["sale_type"] = lookup(mSaleType);
- sd["sale_price"] = mSalePrice;
+ 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"] = std::string(type);
+ sd["sale_price"] = mSalePrice;
+}
+
bool LLSaleInfo::fromLLSD(const LLSD& sd, bool& has_perm_mask, U32& perm_mask)
{
const char *w;