Fix possible crash

This commit is contained in:
Arkadiusz Fal 2023-09-26 17:41:32 +02:00
parent 3be7a5a69f
commit 2dd1d2ac56

View File

@ -35,7 +35,9 @@ struct Sidebar: View {
}
}
.onChange(of: navigation.sidebarSectionChanged) { _ in
scrollScrollViewToItem(scrollView: scrollView, for: navigation.tabSelection)
if let tabSelection = navigation.tabSelection {
scrollScrollViewToItem(scrollView: scrollView, for: navigation.tabSelection)
}
}
.listStyle(.sidebar)
}