From f46816c086e88a5b3e3cc6e936a603c7c07ffac6 Mon Sep 17 00:00:00 2001 From: Harry Barber Date: Thu, 17 Feb 2022 19:44:16 +0000 Subject: [PATCH] Add assertion in clone_bundle_to --- crates/bevy_ecs/src/system/commands/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index fd353e9eaf67f9..734b70aab1284d 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -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:: { source: self.entity, target,