From 04fc8c4db45175cbe036474c53eacdd3b9f56eaa Mon Sep 17 00:00:00 2001
From: Andrey Kleshchev <andreykproductengine@lindenlab.com>
Date: Tue, 27 Jun 2023 00:26:32 +0300
Subject: [PATCH] SL-18629 Fixed missed case of unpacking metadata

---
 indra/llinventory/llinventory.cpp | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp
index ecd070236f7..f0b593bba75 100644
--- a/indra/llinventory/llinventory.cpp
+++ b/indra/llinventory/llinventory.cpp
@@ -215,6 +215,26 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream)
 		{
 			mType = LLAssetType::lookup(valuestr);
 		}
+        else if (0 == strcmp("metadata", keyword))
+        {
+            LLSD metadata(valuestr);
+            if (metadata.has("thumbnail"))
+            {
+                const LLSD& thumbnail = metadata["thumbnail"];
+                if (thumbnail.has("asset_id"))
+                {
+                    setThumbnailUUID(thumbnail["asset_id"].asUUID());
+                }
+                else
+                {
+                    setThumbnailUUID(LLUUID::null);
+                }
+            }
+            else
+            {
+                setThumbnailUUID(LLUUID::null);
+            }
+        }
 		else if(0 == strcmp("name", keyword))
 		{
 			//strcpy(valuestr, buffer + strlen(keyword) + 3);
-- 
GitLab