Commit c4b2336
committed
Fix panic in poll_for_sketch_updates when message system not initialized
sketch_update_handler uses MessageReader<AssetEvent<Sketch>> 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<Sketch> 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" }))1 parent acc5b41 commit c4b2336
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1480 | 1480 | | |
1481 | 1481 | | |
1482 | 1482 | | |
1483 | | - | |
| 1483 | + | |
| 1484 | + | |
1484 | 1485 | | |
1485 | 1486 | | |
1486 | 1487 | | |
| |||
0 commit comments