Sfoglia il codice sorgente

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

tschw 10 anni fa
parent
commit
d2b6bf5207
1 ha cambiato i file con 7 aggiunte e 0 eliminazioni
  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 ) {