allow body on unknown profile

Signed-off-by: kernelkind <kernelkind@gmail.com>
This commit is contained in:
kernelkind
2025-07-09 18:22:18 -04:00
parent b5d56f7831
commit 8c71e154f4
3 changed files with 28 additions and 29 deletions

View File

@@ -68,12 +68,17 @@ pub fn display_name_widget<'a>(
}
}
pub fn about_section_widget<'a, 'b>(profile: &'b ProfileRecord<'a>) -> impl egui::Widget + 'b
pub fn about_section_widget<'a, 'b>(
profile: Option<&'b ProfileRecord<'a>>,
) -> impl egui::Widget + 'b
where
'b: 'a,
{
move |ui: &mut egui::Ui| {
if let Some(about) = profile.record().profile().and_then(|p| p.about()) {
if let Some(about) = profile
.map(|p| p.record().profile())
.and_then(|p| p.and_then(|p| p.about()))
{
let resp = ui.label(about);
ui.add_space(8.0);
resp

View File

@@ -46,7 +46,7 @@ impl<'a, 'cache> ProfilePreview<'a, 'cache> {
&get_display_name(Some(self.profile)),
false,
));
ui.add(about_section_widget(self.profile));
ui.add(about_section_widget(Some(self.profile)));
});
}
}