Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix panic when moving child #8346

Merged
merged 6 commits into from
Apr 17, 2023
Merged

fix panic when moving child #8346

merged 6 commits into from
Apr 17, 2023

Conversation

B-Reif
Copy link
Contributor

@B-Reif B-Reif commented Apr 10, 2023

Objective

When changing an Entity's Parent to a new one from an old Parent that doesn't exist, Bevy panics. Fixes #8337.

Solution

Use get_entity_mut instead of entity_mut in remove_from_children.

@james7132 james7132 added C-Bug An unexpected or incorrect behavior A-Hierarchy Parent-child entity hierarchies P-Crash A sudden unexpected crash labels Apr 10, 2023
@JoJoJet
Copy link
Member

JoJoJet commented Apr 12, 2023

Can you add a regression test? Something based on #8337 (comment) would be good.

@B-Reif
Copy link
Contributor Author

B-Reif commented Apr 14, 2023

Can you add a regression test? Something based on #8337 (comment) would be good.

Sure thing.

@james7132 james7132 modified the milestones: 0.11, 0.10.2 Apr 17, 2023
@james7132 james7132 added this pull request to the merge queue Apr 17, 2023
Merged via the queue into bevyengine:main with commit 7604464 Apr 17, 2023
@B-Reif B-Reif deleted the parent-fix branch April 17, 2023 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Hierarchy Parent-child entity hierarchies C-Bug An unexpected or incorrect behavior P-Crash A sudden unexpected crash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

update_old_parent Doesn't check to see if parent actually exists.
5 participants