浏览代码

mol-state: fix null obj handling in update

David Sehnal 6 年之前
父节点
当前提交
5ae037797f
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/mol-state/state.ts

+ 2 - 1
src/mol-state/state.ts

@@ -311,11 +311,12 @@ function findUpdateRoots(cells: Map<Transform.Ref, StateObjectCell>, tree: State
 
 
 function findUpdateRootsVisitor(n: Transform, _: any, s: { roots: Ref[], cells: Map<Ref, StateObjectCell> }) {
 function findUpdateRootsVisitor(n: Transform, _: any, s: { roots: Ref[], cells: Map<Ref, StateObjectCell> }) {
     const cell = s.cells.get(n.ref);
     const cell = s.cells.get(n.ref);
-    if (cell && cell.obj === StateObject.Null) return false;
     if (!cell || cell.version !== n.version || cell.status === 'error') {
     if (!cell || cell.version !== n.version || cell.status === 'error') {
         s.roots.push(n.ref);
         s.roots.push(n.ref);
         return false;
         return false;
     }
     }
+    // nothing below a Null object can be an update root
+    if (cell && cell.obj === StateObject.Null) return false;
     return true;
     return true;
 }
 }