Skip to content

Commit

Permalink
Add assertion in clone_bundle_to
Browse files Browse the repository at this point in the history
  • Loading branch information
hlbarber committed Feb 17, 2022
1 parent 322af3f commit f46816c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crates/bevy_ecs/src/system/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ impl<'w, 's, 'a> EntityCommands<'w, 's, 'a> {
where
T: Bundle + Clone,
{
assert!(
self.commands.entities.contains(target),
"Attempting to clone from entity {:?} to entity {:?}, which doesn't exist.",
self.entity,
target
);
self.commands.add(CloneBundleTo::<T> {
source: self.entity,
target,
Expand Down

0 comments on commit f46816c

Please sign in to comment.