summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llinventory/llinventory.cpp2
-rw-r--r--indra/llinventory/llsaleinfo.cpp10
2 files changed, 9 insertions, 3 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index 082d8b2f9f..075abf9536 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -918,7 +918,7 @@ void LLInventoryItem::asLLSD( LLSD& sd ) const
}
//sd[INV_FLAGS_LABEL] = (S32)mFlags;
sd[INV_FLAGS_LABEL] = ll_sd_from_U32(mFlags);
- sd[INV_SALE_INFO_LABEL] = mSaleInfo;
+ sd[INV_SALE_INFO_LABEL] = mSaleInfo.asLLSD();
sd[INV_NAME_LABEL] = mName;
sd[INV_DESC_LABEL] = mDescription;
sd[INV_CREATION_DATE_LABEL] = (S32) mCreationDate;
diff --git a/indra/llinventory/llsaleinfo.cpp b/indra/llinventory/llsaleinfo.cpp
index 98836b178e..35bbc1dbb1 100644
--- a/indra/llinventory/llsaleinfo.cpp
+++ b/indra/llinventory/llsaleinfo.cpp
@@ -89,8 +89,14 @@ bool LLSaleInfo::exportLegacyStream(std::ostream& output_stream) const
LLSD LLSaleInfo::asLLSD() const
{
- LLSD sd = LLSD();
- sd["sale_type"] = lookup(mSaleType);
+ LLSD sd;
+ 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_price"] = mSalePrice;
return sd;
}