From 50915fa520d04cd0bca39db3f0ae40e436409444 Mon Sep 17 00:00:00 2001 From: Jerome Humbert Date: Sat, 18 May 2024 16:09:49 +0100 Subject: [PATCH] Fix panic when no effect is present (#325) --- src/render/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/render/mod.rs b/src/render/mod.rs index 06953e72..df146077 100644 --- a/src/render/mod.rs +++ b/src/render/mod.rs @@ -2861,6 +2861,10 @@ pub(crate) fn prepare_bind_groups( render_pipeline: Res, gpu_images: Res>, ) { + if effects_meta.spawner_buffer.is_empty() || effects_meta.spawner_buffer.buffer().is_none() { + return; + } + { #[cfg(feature = "trace")] let _span = bevy::utils::tracing::info_span!("shared_bind_groups").entered();