Browse Source

Merge pull request #6544 from tschw/Editor_misc_fixes

Avoid exception in Editor.add/removeScript w/o selection.
Ricardo Cabello 10 years ago
parent
commit
a1d5c59b10
1 changed files with 7 additions and 0 deletions
  1. 7 0
      editor/js/Sidebar.Script.js

+ 7 - 0
editor/js/Sidebar.Script.js

@@ -45,6 +45,13 @@ Sidebar.Script = function ( editor ) {
 		scriptsContainer.clear();
 		scriptsContainer.clear();
 
 
 		var object = editor.selected;
 		var object = editor.selected;
+
+		if ( object === null ) {
+
+			return;
+
+		}
+
 		var scripts = editor.scripts[ object.uuid ];
 		var scripts = editor.scripts[ object.uuid ];
 
 
 		if ( scripts !== undefined ) {
 		if ( scripts !== undefined ) {