Skip to content

Commit 30c6ca6

Browse files
committed
don't panic when no RenderResourceContext can be found (#1971)
In bevy_webgl2, the `RenderResourceContext` is created after startup as it needs to first wait for an event from js side: https://github.com/mrk-its/bevy_webgl2/blob/f31e5d49def7de6bfe58a47587e7ab3ca349da05/src/lib.rs#L117 remove `panic` introduced in #1965 and log as a `warn` instead
1 parent 80df583 commit 30c6ca6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/bevy_render/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ use bevy_ecs::{
1717
system::{IntoExclusiveSystem, IntoSystem, Res},
1818
};
1919
use bevy_transform::TransformSystem;
20+
use bevy_utils::tracing::warn;
2021
use draw::{OutsideFrustum, Visible};
2122

2223
pub use once_cell;
@@ -229,8 +230,8 @@ impl Plugin for RenderPlugin {
229230

230231
fn check_for_render_resource_context(context: Option<Res<Box<dyn RenderResourceContext>>>) {
231232
if context.is_none() {
232-
panic!(
233+
warn!(
233234
"bevy_render couldn't find a render backend. Perhaps try adding the bevy_wgpu feature/plugin!"
234-
)
235+
);
235236
}
236237
}

0 commit comments

Comments
 (0)