Simple fix for 801 Uncaught TypeError (details below).

entityProperties.js was throwing out: 801 Uncaught TypeError: Cannot read property 'split' of undefined

This moves properties.modelURL related checks behind the property.type validation check to avoid
calling the function on an undefined member if the object doesn't have that key defined.

Changes Committed:
    modified:   scripts/system/html/js/entityProperties.js
This commit is contained in:
LaShonda Hopper 2018-02-14 17:00:52 -05:00
parent 6187731fdc
commit d466c079a4

View file

@ -798,10 +798,13 @@ function loaded() {
// HTML workaround since image is not yet a separate entity type
var IMAGE_MODEL_NAME = 'default-image-model.fbx';
var urlParts = properties.modelURL.split('/')
var propsFilename = urlParts[urlParts.length - 1];
if (properties.type === "Model" && propsFilename === IMAGE_MODEL_NAME) {
properties.type = "Image";
if (properties.type === "Model") {
var urlParts = properties.modelURL.split('/');
var propsFilename = urlParts[urlParts.length - 1];
if (propsFilename === IMAGE_MODEL_NAME) {
properties.type = "Image";
}
}
// Create class name for css ruleset filtering