1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-20 00:46:34 +00:00

Hotfix panic when icon is not found (#506)

This commit is contained in:
jugeeya 2023-03-14 07:21:14 -07:00 committed by GitHub
parent 58a18de2b9
commit 14bf45de4f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -112,10 +112,13 @@ unsafe fn render_submenu_page(app: &App, root_pane: &mut Pane) {
// Hide all icon images, and strategically mark the icon that
// corresponds with a particular button to be visible.
submenu_ids.iter().for_each(|id| {
menu_button
.find_pane_by_name_recursive(id)
.unwrap()
// TODO: Break if ID not found on release
let icon = menu_button
.find_pane_by_name_recursive(id);
if let Some(icon) = icon {
icon
.set_visible(id == &submenu.submenu_id);
}
});
menu_button