summaryrefslogtreecommitdiff
path: root/indra/llinventory/llinventory.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llinventory/llinventory.cpp')
-rw-r--r--indra/llinventory/llinventory.cpp24
1 files changed, 16 insertions, 8 deletions
diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index c83717fef5..14bd7db617 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -200,19 +200,21 @@ void LLInventoryObject::setFavorite(bool favorite)
void LLInventoryObject::setRuntime(std::string_view runtime)
{
- if (getType() == LLAssetType::AT_LSL_TEXT)
- {
- mRuntime = runtime;
- }
- else
- {
- mRuntime.clear();
- }
+ // Store the runtime unconditionally; it will be validated/cleared
+ // when the final asset type is known (see setType()).
+ mRuntime = runtime;
}
void LLInventoryObject::setType(LLAssetType::EType type)
{
mType = type;
+
+ // Only LSL text assets are expected to have a runtime; clear any
+ // previously stored runtime for other asset types.
+ if (mType != LLAssetType::AT_LSL_TEXT)
+ {
+ mRuntime.clear();
+ }
}
@@ -1105,6 +1107,12 @@ bool LLInventoryItem::fromLLSD(const LLSD& sd, bool is_new)
{
mRuntime = script_map[w].asString();
}
+ else
+ {
+ // Clear any stale runtime when a script block is present
+ // but no explicit runtime value is provided.
+ mRuntime.clear();
+ }
continue;
}