From 321133c96cb9c7ff9c30b2ca80c9ccceaa6753e1 Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Sun, 16 Jun 2024 21:02:21 +0900 Subject: [PATCH] Update glow_integration.rs --- crates/eframe/src/native/glow_integration.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/eframe/src/native/glow_integration.rs b/crates/eframe/src/native/glow_integration.rs index ae5dd33ae93..bfb730fa891 100644 --- a/crates/eframe/src/native/glow_integration.rs +++ b/crates/eframe/src/native/glow_integration.rs @@ -1261,11 +1261,12 @@ impl GlutinWindowContext { if let Some(viewport) = self.viewports.get(&viewport_id) { if let Some(gl_surface) = &viewport.gl_surface { change_gl_context(&mut self.current_gl_context, gl_surface); + let Some(current_gl_context) = self.current_gl_context.as_ref() else { + return; + }; gl_surface.resize( - self.current_gl_context - .as_ref() - .expect("failed to get current context to resize surface"), + current_gl_context, width_px, height_px, );