瀏覽代碼

Avoid exception in Editor.add/removeScript w/o selection.

tschw 10 年之前
父節點
當前提交
d2b6bf5207
共有 1 個文件被更改,包括 7 次插入0 次删除
  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 ) {