Skip to content
Snippets Groups Projects
Commit 5ae03779 authored by David Sehnal's avatar David Sehnal
Browse files

mol-state: fix null obj handling in update

parent 98f15250
No related branches found
No related tags found
No related merge requests found
...@@ -311,11 +311,12 @@ function findUpdateRoots(cells: Map<Transform.Ref, StateObjectCell>, tree: State ...@@ -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;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment