Explorar el Código

SceneEditor: Fix exception

trethaller hace 7 años
padre
commit
7340bbbe26
Se han modificado 2 ficheros con 3 adiciones y 0 borrados
  1. 2 0
      hide/comp/IconTree.hx
  2. 1 0
      hide/comp/SceneEditor.hx

+ 2 - 0
hide/comp/IconTree.hx

@@ -162,6 +162,8 @@ class IconTree<T:{}> extends Component {
 
 	public function getElement(e : T) : Element {
 		var v = getRev(e);
+		if(v == null)
+			return null;
 		var el = (element:Dynamic).jstree('get_node', v.id, true);
 		return el;
 	}

+ 1 - 0
hide/comp/SceneEditor.hx

@@ -305,6 +305,7 @@ class SceneEditor {
 		tree.refresh(function() {
 			for(elt in sh.contexts.keys()) {
 				var el = tree.getElement(elt);
+				if(el == null) continue;
 				updateTreeStyle(elt, el);
 			}
 			if(callb != null) callb();