From d466c079a4c4a89738ae9d045bcb946953861e7c Mon Sep 17 00:00:00 2001 From: LaShonda Hopper Date: Wed, 14 Feb 2018 17:00:52 -0500 Subject: [PATCH] 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 --- scripts/system/html/js/entityProperties.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 35235634e9..b27c852974 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -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