We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 653c103 + 05f293b commit 532195aCopy full SHA for 532195a
crates/bevy_ecs/src/system/commands.rs
@@ -338,7 +338,9 @@ where
338
T: Bundle + 'static,
339
{
340
fn write(self: Box<Self>, world: &mut World) {
341
- world.entity_mut(self.entity).insert_bundle(self.bundle);
+ if let Some(mut entity_mut) = world.get_entity_mut(self.entity) {
342
+ entity_mut.insert_bundle(self.bundle);
343
+ }
344
}
345
346
@@ -353,7 +355,9 @@ where
353
355
T: Component,
354
356
357
- world.entity_mut(self.entity).insert(self.component);
358
359
+ entity_mut.insert(self.component);
360
361
362
363
0 commit comments