summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llmaterialeditor.cpp10
-rw-r--r--indra/newview/llmaterialeditor.h4
-rw-r--r--indra/newview/llviewermenu.cpp2
3 files changed, 12 insertions, 4 deletions
diff --git a/indra/newview/llmaterialeditor.cpp b/indra/newview/llmaterialeditor.cpp
index 58cebecb23..319f98b816 100644
--- a/indra/newview/llmaterialeditor.cpp
+++ b/indra/newview/llmaterialeditor.cpp
@@ -1406,13 +1406,21 @@ void LLMaterialEditor::loadLiveMaterial(LLUUID &asset_id)
LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor", LLSD(LIVE_MATERIAL_EDITOR_KEY));
me->setTitle(me->getString("material_override_title"));
me->setAssetId(asset_id);
- me->setFromGLTFMaterial(gGLTFMaterialList.getMaterial(asset_id));
+ if (asset_id.notNull())
+ {
+ me->setFromGLTFMaterial(gGLTFMaterialList.getMaterial(asset_id));
+ }
me->openFloater();
me->setFocus(TRUE);
}
void LLMaterialEditor::loadFromGLTFMaterial(LLUUID &asset_id)
{
+ if (asset_id.isNull())
+ {
+ LL_WARNS() << "Trying to open material with null id" << LL_ENDL;
+ return;
+ }
LLMaterialEditor* me = (LLMaterialEditor*)LLFloaterReg::getInstance("material_editor");
me->setTitle(LLTrans::getString("New Material"));
me->setHasUnsavedChanges(true);
diff --git a/indra/newview/llmaterialeditor.h b/indra/newview/llmaterialeditor.h
index 8945e113a4..3b2648cba5 100644
--- a/indra/newview/llmaterialeditor.h
+++ b/indra/newview/llmaterialeditor.h
@@ -103,9 +103,9 @@ public:
// will promt to select specific one
static void loadMaterialFromFile(const std::string& filename, S32 index = -1);
- static void LLMaterialEditor::loadLiveMaterial(LLUUID &asset_id);
+ static void loadLiveMaterial(LLUUID &asset_id);
- static void LLMaterialEditor::loadFromGLTFMaterial(LLUUID &asset_id);
+ static void loadFromGLTFMaterial(LLUUID &asset_id);
static void onLoadComplete(const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status);
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index ffa104230e..4d04c6c85e 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -2812,7 +2812,7 @@ bool enable_object_save_gltf_material()
LLSelectedTEGetmatIdAndPermissions func;
LLUUID mat_id;
LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&func, mat_id);
- return func.mCanCopy;
+ return func.mCanCopy && mat_id.notNull();
}
bool enable_object_open()