diff options
author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-01-22 17:33:54 +0200 |
---|---|---|
committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-01-22 18:59:38 +0200 |
commit | ad30637ebe987a126302dc7fd978e0bfb988ccb1 (patch) | |
tree | dfb4d3a6e65ab024625bbdb858db92dd6c13f9b9 | |
parent | 5af750a1304f795fae4d6e8336defe1eff3f3659 (diff) |
#3452 Crash in LLSaleInfo::asLLSD()
-rw-r--r-- | indra/llinventory/llinventory.cpp | 2 | ||||
-rw-r--r-- | indra/llinventory/llsaleinfo.cpp | 10 |
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; } |