diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llselectmgr.cpp | 10 | ||||
-rw-r--r-- | indra/newview/lltooldraganddrop.cpp | 5 |
2 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 7f1f90592f..fceb25b3d3 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -2251,11 +2251,15 @@ void LLSelectMgr::selectionRevertGLTFMaterials() // Update material locally objectp->setRenderMaterialID(te, asset_id, false /*wait for LLGLTFMaterialList update*/); - LLGLTFMaterial* material = new LLGLTFMaterial(*nodep->mSavedGLTFOverrideMaterials[te]); - objectp->setTEGLTFMaterialOverride(te, material); + LLGLTFMaterial* material = nodep->mSavedGLTFOverrideMaterials[te]; + if (material) + { + material = new LLGLTFMaterial(*material); + objectp->setTEGLTFMaterialOverride(te, material); + } // Enqueue update to server - if (asset_id.notNull()) + if (asset_id.notNull() && material) { // Restore overrides and base material LLGLTFMaterialList::queueApply(objectp, te, asset_id, material); 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 |