fix: don't panic on empty active_tab
@@ -193,10 +193,12 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
return;
}
- let buffer = match data
+ let buffer = match &data.main_split.active_tab.as_ref() {
+ Some(active_tab) => {
+ match data
.main_split
.editor_tabs
- .get(&data.main_split.active_tab.unwrap())
+ .get(active_tab)
.unwrap()
.active_child()
{
@@ -206,6 +208,9 @@ fn paint(&mut self, ctx: &mut PaintCtx, data: &LapceTabData, env: &Env) {
lapce_data::data::EditorTabChild::Settings(view_id, _) => {
data.editor_view_content(*view_id)
}
+ }
+ }
+ None => return,
};
let rect = ctx.size().to_rect();
