From c4b2336e2fc7425ef23dc9226d34a541afe176a3 Mon Sep 17 00:00:00 2001 From: Jose Llamas Date: Tue, 4 Aug 2026 02:20:30 -0700 Subject: [PATCH] Fix panic in poll_for_sketch_updates when message system not initialized sketch_update_handler uses MessageReader> which requires Bevy's message system to be initialized. When called via run_system_cached before the app is fully started, it returns SystemParamValidationError instead of a value, causing unwrap() to panic. Fix: use .ok().flatten() to return None gracefully when the system isn't ready, matching the expected Option return type. Fixes: thread panicked at crates/processing_render/src/lib.rs called Result::unwrap() on Err(Failed(SystemParamValidationError { message: "Message not initialized", field: "::messages" })) --- crates/processing_render/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/processing_render/src/lib.rs b/crates/processing_render/src/lib.rs index 0718e5e..f081a7d 100644 --- a/crates/processing_render/src/lib.rs +++ b/crates/processing_render/src/lib.rs @@ -1480,7 +1480,8 @@ pub fn poll_for_sketch_updates() -> error::Result> { Ok(app .world_mut() .run_system_cached(sketch::sketch_update_handler) - .unwrap()) + .ok() + .flatten()) }) }