diff --git a/js/cells/DMACell.js b/js/cells/DMACell.js index df65540700e8a75feecae155e9b87e3db3381e70..ae633d42d1b7caef1c0ffbd20a3b79dcd78dca58 100644 --- a/js/cells/DMACell.js +++ b/js/cells/DMACell.js @@ -234,7 +234,7 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'globals', ' } var material = materials.getMaterialForId(this.materialName, returnTHREEObject, this.isTransparent); if (!material) { - console.warn("no material object found of type " + id); + console.warn("no material object found of type " + this.materialName); return null; } return material; diff --git a/js/materials/DMAMaterials.js b/js/materials/DMAMaterials.js index bf1810224bf8e15bdd995739333d06f51af12e64..15ecbf33053ca254ee82c53f72368561a030ed3d 100644 --- a/js/materials/DMAMaterials.js +++ b/js/materials/DMAMaterials.js @@ -77,6 +77,10 @@ define(['underscore', 'three', 'appState', 'lattice', 'plist', 'threeModel'], fu function getMaterialForId(id, returnTHREEObject, transparent){ var material = materialsList[id]; if (!returnTHREEObject) return material; + if (!material){ + console.warn("no material object found for type "+ id); + return null; + } if (!material.threeMaterial){ console.warn("no three material object found for type "+ id); return null;