From a9b445020bfe201f38a69225ada5a0e0a5977dbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Mary=C5=84czak?= Date: Tue, 15 Aug 2023 21:57:27 +0200 Subject: [PATCH] Don't panic on resize of hidden frame (#39) --- src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 1c43f36..80db355 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -338,10 +338,10 @@ where } fn resize(&mut self, width: NonZeroU32, height: NonZeroU32) { - let decorations = self - .decorations - .as_mut() - .expect("trying to resize the hidden frame."); + let Some(decorations) = self.decorations.as_mut() else { + log::error!("trying to resize the hidden frame."); + return; + }; decorations.resize(width.get(), height.get()); self.buttons