Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When using `insert` instead of `try_insert` on `EntityCommand`, it can happen that the system panics, when the entity does not exist, even when the `EntityCommand` has been accessed with `get_entity(...)`. The following example demonstrates the problem: ```rust if let Some(mut entity_commands) = commands.get_entity(entity) { // at this point some other system despawns `entity` concurrently entity_commands.insert(bundle); // ^^^^^^ this will panic } ``` This is also documented in the official bevy docs: https://docs.rs/bevy/0.12.1/bevy/ecs/system/struct.Commands.html#method.get_entity
- Loading branch information