fix: Graph.isValidAncestor manages null Cell parameter#699
Conversation
At runtime, some code pass a `null` Cell parameter, for example in `Graph.getEdges`. Previously, the implementation thrown an error if Cell was null. Also improve the signature of Graph.isValidAncestor - the `cell` parameter accepts `null` values - the `recurse` parameter is marked as optional
WalkthroughThe pull request updates the Changes
Sequence Diagram(s)sequenceDiagram
participant TS as Test Suite
participant M as isValidAncestor Method
participant C as Cell Instance
TS->>M: Call isValidAncestor(cell, parent, recurse)
alt cell is not null
M->>C: Safely access parent with cell?.getParent()
C-->>M: Return parent info (or undefined)
else cell is null
Note right of M: Skip parent access
end
M-->>TS: Return false result
sequenceDiagram
participant E as EdgeMixin.getEdges
participant M as isValidAncestor Method
E->>M: Validate source cell (source, parent, recurse)
M-->>E: Return validation result
E->>M: Validate target cell (target, parent, recurse)
M-->>E: Return validation result
E-->>Caller: Return valid/invalid edges
Possibly related PRs
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
|



At runtime, some code pass a
nullCell parameter, for example inGraph.getEdges. Previously, the implementationthrown an error if Cell was
null.Also improve the signature of
Graph.isValidAncestorcellparameter acceptsnullvaluesrecurseparameter is marked as optionalNotes
Closes #236
Summary by CodeRabbit