summaryrefslogtreecommitdiff
path: root/indra/newview/lltooldraganddrop.cpp
diff options
context:
space:
mode:
authorBrad Linden <46733234+brad-linden@users.noreply.github.com>2024-12-13 16:13:30 -0800
committerGitHub <noreply@github.com>2024-12-13 16:13:30 -0800
commit5b77436cf0ad749d36e8f0c60077eeb24698d644 (patch)
tree76fe43e4c22d672e7180fc6d6e3eee488d6d521c /indra/newview/lltooldraganddrop.cpp
parent67b9779d555cf749cfb9011382f261ffa84028aa (diff)
#3288 null overrides crashes (#3289)
* Fixes for secondlife/viewer#3288 override copy related crashes when overrides can be nullptr
Diffstat (limited to 'indra/newview/lltooldraganddrop.cpp')
-rw-r--r--indra/newview/lltooldraganddrop.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp
index 6be7ec2262..4efa289141 100644
--- a/indra/newview/lltooldraganddrop.cpp
+++ b/indra/newview/lltooldraganddrop.cpp
@@ -1447,9 +1447,10 @@ void LLToolDragAndDrop::dropTexture(LLViewerObject* hit_obj,
}
LLTextureEntry* te = hit_obj->getTE(hit_face);
- if (te && !remove_pbr)
+ LLGLTFMaterial * override_mat = nullptr;
+ if (te && !remove_pbr && (override_mat = te->getGLTFMaterialOverride()))
{
- LLGLTFMaterial* copy = new LLGLTFMaterial(*te->getGLTFMaterialOverride());
+ LLGLTFMaterial* copy = new LLGLTFMaterial(*override_mat);
nodep->mSavedGLTFOverrideMaterials[hit_face] = copy;
}
else