diff --git a/Shared/Navigation/Sidebar.swift b/Shared/Navigation/Sidebar.swift index 29ce7dc7..a2b3a712 100644 --- a/Shared/Navigation/Sidebar.swift +++ b/Shared/Navigation/Sidebar.swift @@ -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) }