From 2b0fe6c1d591b93f9147e9b57c8c082f05ef9660 Mon Sep 17 00:00:00 2001 From: connerebbinghaus Date: Sun, 15 Jan 2023 13:07:54 -0500 Subject: [PATCH] Fix panic due to missing swapchain texture. (#141) * Fix panic due to missing swapchain texture. * Format. --- src/egui_node.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/egui_node.rs b/src/egui_node.rs index 581100d43..1ee93cf90 100644 --- a/src/egui_node.rs +++ b/src/egui_node.rs @@ -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::().unwrap(); let (vertex_buffer, index_buffer) = match (&self.vertex_buffer, &self.index_buffer) { @@ -329,8 +336,6 @@ impl Node for EguiNode { let egui_transforms = world.get_resource::().unwrap(); - let swap_chain_texture = extracted_window.swap_chain_texture.as_ref().unwrap(); - let mut render_pass = render_context .command_encoder