Skip to content

"Cannot read properties of null" in isValidAncestor(cell, parent, recurse = false) #236

@sdgoldstein

Description

@sdgoldstein

I have a graph in which I'm toggling the visible state of cells. When doing so, I hit an error in isValidAncestor(cell, parent, recurse = false) during graph layout where the cell argument is null.

Tracing the stack and debugging, I see the following call flow from the layout:

graph.getConnections(cell, parent) -> graph.getEdges(cell, parent, true, true, false) -> isValidAncestor(cell, parent, recurse = false)

And the isValidAncestor method is called because:

  1. The edge is an outgoing edge
  2. The call to getView().getState(edge) returns null
  3. Because of 2, the target variable is set by a call to this.getView().getVisibleTerminal(edges[i], false) which also returns null because the target of the edge has been set to not be visible

I've tried to reproduce this with a simple test case, but I can't reproduce 2 above. In my simple test case, the state is available for the cell and thus the target of the edge is in the cached state

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions