From 5a706086fefa6058389dc35707fc6b0c8ccece2d Mon Sep 17 00:00:00 2001
From: Cosmic Linden <cosmic@lindenlab.com>
Date: Fri, 21 Jul 2023 17:32:08 -0700
Subject: SL-20053: Fix sometimes unable to unset a PBR material on a prim.

Caused by inventory item asset IDs being null. Seems suspicious. But working around it for now seems best.
---
 indra/newview/lltexturectrl.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp
index b3310a1f9a..c13376d0a6 100644
--- a/indra/newview/lltexturectrl.cpp
+++ b/indra/newview/lltexturectrl.cpp
@@ -693,6 +693,11 @@ void LLFloaterTexturePicker::draw()
 
 const LLUUID& LLFloaterTexturePicker::findItemID(const LLUUID& asset_id, BOOL copyable_only, BOOL ignore_library)
 {
+	if (asset_id.isNull())
+	{
+		return LLUUID::null;
+	}
+
 	LLViewerInventoryCategory::cat_array_t cats;
 	LLViewerInventoryItem::item_array_t items;
 	LLAssetIDMatches asset_id_matches(asset_id);
-- 
cgit v1.2.3