diff --git a/binaries/data/mods/official/gui/test/functions_page_session.js b/binaries/data/mods/official/gui/test/functions_page_session.js index 3ca9c2679d..5ce8005d09 100644 --- a/binaries/data/mods/official/gui/test/functions_page_session.js +++ b/binaries/data/mods/official/gui/test/functions_page_session.js @@ -211,7 +211,7 @@ function resetUpdateVars() propertyWatches[watchedObject].unwatchAll( selectionWatchHandler ); // Remove the handler propertyWatches = new Array(); - if( selection[0] ) + if( selection.length > 0 && selection[0] ) { // Watch the object itself selection[0].watchAll( selectionWatchHandler ); @@ -228,7 +228,7 @@ function resetUpdateVars() } } selectionChanged = false; - if( selection[0] ) + if( selection.length > 0 && selection[0] ) { selectionTemplate = selection[0].template; }