diff options
| -rw-r--r-- | indra/llinventory/llinventory.cpp | 24 | ||||
| -rw-r--r-- | indra/llinventory/llinventory.h | 2 |
2 files changed, 17 insertions, 9 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; } diff --git a/indra/llinventory/llinventory.h b/indra/llinventory/llinventory.h index ad270f317d..c22b17ab66 100644 --- a/indra/llinventory/llinventory.h +++ b/indra/llinventory/llinventory.h @@ -72,7 +72,7 @@ public: const LLUUID& getParentUUID() const; virtual const LLUUID& getThumbnailUUID() const; virtual bool getIsFavorite() const; - virtual std::string getRuntime() const; + virtual const std::string& getRuntime() const; virtual const std::string& getName() const; virtual LLAssetType::EType getType() const; LLAssetType::EType getActualType() const; // bypasses indirection for linked items |
