Return early from panel PageInner::update function if no panel_config

This fixes a potential panic if the dock or panel configs are not
defined.
This commit is contained in:
Jeremy Soller 2023-09-13 14:18:15 -06:00
parent 367d50ab2d
commit 6316c8cc17
No known key found for this signature in database
GPG key ID: DCFCA852D3906975

View file

@ -324,7 +324,9 @@ impl PageInner {
#[allow(clippy::too_many_lines)]
pub fn update(&mut self, message: Message) {
let helper = self.config_helper.as_ref().unwrap();
let mut panel_config = self.panel_config.as_mut().unwrap();
let Some(mut panel_config) = self.panel_config.as_mut() else {
return
};
match message {
Message::AutoHidePanel(enabled) => {