Repository navigation
fix(graph): prevent crash when previewing node without outputs (#4883) - #4899
Open
HarshithJeevan-pixel wants to merge 3 commits into
Open
HarshithJeevan-pixel wants to merge 3 commits into
HarshithJeevan-pixel wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
All reported issues were addressed across 5 files
Reply to a comment to ask cubic a question or push back. It learns from your replies.
Re-trigger cubic
Member
|
The diff is definetly to big. We should do a targeted fix here and we should not require compiler changes |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4883
Description
When entering an empty custom node, returning to the document, and clicking "Preview", the editor panicked with:
panicked at node-graph/graph-craft/src/document.rs: index out of bounds: the len is 0 but the index is 0This happened because:
original_location.dependantshas length 0.replace_node_with_its_exportsandflatten_with_fnsdirectly indexed into.dependants[...]without bounds checking.toggle_previewallowed setting preview on a node with 0 outputs.Changes
.get()and.get_mut()for bounds-safe indexing intoOriginalLocation.dependants.toggle_previewandapply_previewsagainst nodes with 0 outputs.