Skip to content

Commit 42f2124

Browse files
authored
Merge pull request #92 from hoshino111/2d_minimise
Fix crash while minimizing window with ui camera
2 parents 2df9f5d + 559172d commit 42f2124

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

crates/bevy_ui/src/render/render_pass.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ impl Node for UiPassNode {
6666
world: &World,
6767
) -> Result<(), NodeRunError> {
6868
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
69-
let (transparent_phase, target) = self
70-
.query
71-
.get_manual(world, view_entity)
72-
.expect("view entity should exist");
69+
// If there is no view entity, do not try to process the render phase for the view
70+
let (transparent_phase, target) = match self.query.get_manual(world, view_entity) {
71+
Ok(it) => it,
72+
_ => return Ok(()),
73+
};
7374
let pass_descriptor = RenderPassDescriptor {
7475
label: Some("ui_pass"),
7576
color_attachments: &[RenderPassColorAttachment {

0 commit comments

Comments
 (0)