diff --git a/Cargo.toml b/Cargo.toml index aebb5ab..fa0d340 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bevy_sync" -version = "0.14.1" +version = "0.14.2" edition = "2021" authors = ["Raffaele Ragni "] license = "MIT OR Apache-2.0" diff --git a/src/lib_priv.rs b/src/lib_priv.rs index 705a2d6..a95538c 100644 --- a/src/lib_priv.rs +++ b/src/lib_priv.rs @@ -247,6 +247,12 @@ impl SyncComponent for App { >( &mut self, ) -> &mut Self { + // application may try to setup sync without knowing if bevy_sync was enabled. + if self.world().get_resource::().is_none() { + warn!("Trying to register sync_component in bevy_sync, but bevy_sync is not enabled."); + return self; + } + self.register_type::(); self.register_type_data::(); let c_id = self.world_mut().init_component::();