Fix the common crash, not quite sure why LL doesn't get this one

This fix does a few things:
1. LLMaterialID initializing an LLSD implicitly from a uuid and
thus not having it be a Binary, and not overriding LLSD::asBinary,
UUIDs are now checked for when receiving an LLSD in constructor
2. Implicitly using a UUID shortcuts to just calling set with the mData.
This commit is contained in:
Liru Færs
2019-10-22 21:00:17 -04:00
parent d3572dd4ec
commit 54c4b1de83
2 changed files with 6 additions and 2 deletions

View File

@@ -42,8 +42,11 @@ LLMaterialID::LLMaterialID()
LLMaterialID::LLMaterialID(const LLSD& pMaterialID)
{
llassert(pMaterialID.isBinary());
parseFromBinary(pMaterialID.asBinary());
llassert(pMaterialID.isBinary() || pMaterialID.isUUID());
if (pMaterialID.isUUID())
set(pMaterialID.asUUID().mData);
else
parseFromBinary(pMaterialID.asBinary());
}
LLMaterialID::LLMaterialID(const LLSD::Binary& pMaterialID)

View File

@@ -36,6 +36,7 @@ class LLMaterialID
{
public:
LLMaterialID();
LLMaterialID(const LLUUID& id) { set(id.mData); }
LLMaterialID(const LLSD& pMaterialID);
LLMaterialID(const LLSD::Binary& pMaterialID);
LLMaterialID(const void* pMemory);