Skip to content

Commit

Permalink
fix crash while minimizing window with ui camera
Browse files Browse the repository at this point in the history
  • Loading branch information
hoshino111 authored and DJMcNab committed May 28, 2022
1 parent 8907d1a commit 2a3072b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions crates/bevy_ui/src/render/render_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,16 @@ impl Node for UiPassNode {
world: &World,
) -> Result<(), NodeRunError> {
let view_entity = graph.get_input_entity(Self::IN_VIEW)?;
let (transparent_phase, target) = self
.query
.get_manual(world, view_entity)
.expect("view entity should exist");

// If there is no view entity, do not try to process the render phase for the view
let (transparent_phase, target) = match self.query.get_manual(world, view_entity) {
Ok(it) => it,
_ => return Ok(()),
};

if transparent_phase.items.is_empty() {
return Ok(());
}

let pass_descriptor = RenderPassDescriptor {
label: Some("ui_pass"),
color_attachments: &[RenderPassColorAttachment {
Expand Down

0 comments on commit 2a3072b

Please sign in to comment.