diff --git a/indra/newview/llpanelface.cpp b/indra/newview/llpanelface.cpp
index da471b0b62d39f33e92ef4365f84da9b18838b82..2aba115e3f3ae1bb4253b4545b4594c9a98e8edd 100644
--- a/indra/newview/llpanelface.cpp
+++ b/indra/newview/llpanelface.cpp
@@ -2988,7 +2988,7 @@ void LLPanelFace::onCopyFaces()
                     // Replace no-copy textures, destination texture will get used instead if available
                     if (mat_data.has("NormMap"))
                     {
-                        LLUUID id = te_data["material"]["NormMap"].asUUID();
+                        LLUUID id = mat_data["NormMap"].asUUID();
                         if (id.notNull() && !LLPanelObject::canCopyTexture(id))
                         {
                             mat_data["NormMap"] = LLUUID(gSavedSettings.getString( "DefaultObjectTexture" ));
@@ -2998,7 +2998,7 @@ void LLPanelFace::onCopyFaces()
                     }
                     if (mat_data.has("SpecMap"))
                     {
-                        LLUUID id = te_data["material"]["SpecMap"].asUUID();
+                        LLUUID id = mat_data["SpecMap"].asUUID();
                         if (id.notNull() && !LLPanelObject::canCopyTexture(id))
                         {
                             mat_data["SpecMap"]  = LLUUID(gSavedSettings.getString( "DefaultObjectTexture" ));