Skip to content

Commit

Permalink
Fix panic due to missing swapchain texture. (#141)
Browse files Browse the repository at this point in the history
* Fix panic due to missing swapchain texture.

* Format.
  • Loading branch information
connerebbinghaus authored Jan 15, 2023
1 parent b1c3525 commit 2b0fe6c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/egui_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,13 @@ impl Node for EguiNode {
return Ok(()); // No window
};

let swap_chain_texture =
if let Some(swap_chain_texture) = extracted_window.swap_chain_texture.as_ref() {
swap_chain_texture
} else {
return Ok(()); // No swapchain texture
};

let render_queue = world.get_resource::<RenderQueue>().unwrap();

let (vertex_buffer, index_buffer) = match (&self.vertex_buffer, &self.index_buffer) {
Expand All @@ -329,8 +336,6 @@ impl Node for EguiNode {

let egui_transforms = world.get_resource::<EguiTransforms>().unwrap();

let swap_chain_texture = extracted_window.swap_chain_texture.as_ref().unwrap();

let mut render_pass =
render_context
.command_encoder
Expand Down

0 comments on commit 2b0fe6c

Please sign in to comment.