aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2023-02-23 18:46:41 -0600
committermat <github@matdoes.dev>2023-02-23 18:46:41 -0600
commit21e3f73c23d750995a1bf715fe6191584cf4064d (patch)
tree9280a4aaf0f29e4f8f285091094c5185ccb28759
parent54a2eb9c95dff8c4feb21e26dc9179c906e1b2db (diff)
downloadazalea-drasl-21e3f73c23d750995a1bf715fe6191584cf4064d.tar.xz
check entity for retroactively_add_game_profile_component
-rwxr-xr-xazalea-client/src/player.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/azalea-client/src/player.rs b/azalea-client/src/player.rs
index 3680e2d0..8bccedc8 100755
--- a/azalea-client/src/player.rs
+++ b/azalea-client/src/player.rs
@@ -36,9 +36,9 @@ pub fn retroactively_add_game_profile_component(
) {
for event in events.iter() {
if let Some(entity) = entity_infos.get_entity_by_uuid(&event.info.uuid) {
- commands
- .entity(entity)
- .insert(GameProfileComponent(event.info.profile.clone()));
+ if let Some(mut entity_commands) = commands.get_entity(entity) {
+ entity_commands.insert(GameProfileComponent(event.info.profile.clone()));
+ }
}
}
}