Skip to content

Fix panic when hiding nodes with zero inputs#4134

Open
kimjune01 wants to merge 1 commit intoGraphiteEditor:masterfrom
kimjune01:fix/crash-hiding-zero-input-nodes
Open

Fix panic when hiding nodes with zero inputs#4134
kimjune01 wants to merge 1 commit intoGraphiteEditor:masterfrom
kimjune01:fix/crash-hiding-zero-input-nodes

Conversation

@kimjune01
Copy link
Copy Markdown

Fixes #3629.

Nodes like PointerPositionNode have no value inputs — they only receive context. drain(1..) panics on an empty Vec. Guard with an is_empty check: push a synthetic None input for empty-input nodes, truncate(1) otherwise.

Adds regression tests for zero-input and multi-input hidden nodes.

Nodes like PointerPositionNode have no value inputs (context-only).
drain(1..) panics on an empty Vec. Guard with an is_empty check:
push a synthetic None input for empty nodes, truncate to 1 otherwise.

Adds regression tests for zero-input and multi-input cases.

Fixes GraphiteEditor#3629
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request fixes a panic in NodeNetwork that occurred when hiding a node with zero inputs. The code now safely handles empty input vectors by adding a default input or truncating to the first element, ensuring passthrough nodes maintain the required single input. Two unit tests were added to verify the fix and prevent regressions. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Crash when hiding an 'Instance Position' or 'Pointer Position' node feeding a value

1 participant