summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Linden <brad@lindenlab.com>2023-07-14 12:46:20 -0700
committerBrad Linden <brad@lindenlab.com>2023-07-14 12:46:20 -0700
commit2f8f1c7a44f45490db5b5f040914e42aef2f5280 (patch)
tree51736afd8ad1f230ed0a83887f90db3294eb9422
parentd192d91db95ec9ed3ad47039e126134bc05ad5f4 (diff)
Fix crash SL-20013 crash when applying nocopy material via drag-and-drop
-rw-r--r--indra/newview/lltooldraganddrop.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 4705970c7b..1918d11964 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1096,12 +1096,16 @@ void LLToolDragAndDrop::dropMaterialOneFace(LLViewerObject* hit_obj,
LL_WARNS() << "LLToolDragAndDrop::dropTextureOneFace no material item." << LL_ENDL;
return;
}
+
+ // SL-20013 must save asset_id before handleDropMaterialProtections since our item instance
+ // may be deleted if it is moved into task inventory
+ LLUUID asset_id = item->getAssetUUID();
BOOL success = handleDropMaterialProtections(hit_obj, item, source, src_id);
if (!success)
{
return;
}
- LLUUID asset_id = item->getAssetUUID();
+
if (asset_id.isNull())
{
// use blank material
@@ -1127,13 +1131,17 @@ void LLToolDragAndDrop::dropMaterialAllFaces(LLViewerObject* hit_obj,
LL_WARNS() << "LLToolDragAndDrop::dropTextureAllFaces no material item." << LL_ENDL;
return;
}
+
+ // SL-20013 must save asset_id before handleDropMaterialProtections since our item instance
+ // may be deleted if it is moved into task inventory
+ LLUUID asset_id = item->getAssetUUID();
BOOL success = handleDropMaterialProtections(hit_obj, item, source, src_id);
+
if (!success)
{
return;
}
- LLUUID asset_id = item->getAssetUUID();
if (asset_id.isNull())
{
// use blank material