瀏覽代碼

Merge pull request #6544 from tschw/Editor_misc_fixes

Avoid exception in Editor.add/removeScript w/o selection.
Ricardo Cabello 10 年之前
父節點
當前提交
a1d5c59b10
共有 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();
 
 		var object = editor.selected;
+
+		if ( object === null ) {
+
+			return;
+
+		}
+
 		var scripts = editor.scripts[ object.uuid ];
 
 		if ( scripts !== undefined ) {