From 825424cfba245d8c7db7bfd3c0128890441ef7e4 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 5 Feb 2023 11:09:08 -0500 Subject: [PATCH] Fix crash when tapping My Profile tab before view is loaded Closes #352 --- Tusker/Screens/Profile/ProfileViewController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tusker/Screens/Profile/ProfileViewController.swift b/Tusker/Screens/Profile/ProfileViewController.swift index cf5a29ce..bc8d02cc 100644 --- a/Tusker/Screens/Profile/ProfileViewController.swift +++ b/Tusker/Screens/Profile/ProfileViewController.swift @@ -335,12 +335,14 @@ extension ProfileViewController: TabbedPageViewController { extension ProfileViewController: TabBarScrollableViewController { func tabBarScrollToTop() { + guard isViewLoaded else { return } currentViewController.tabBarScrollToTop() } } extension ProfileViewController: StatusBarTappableViewController { func handleStatusBarTapped(xPosition: CGFloat) -> StatusBarTapActionResult { + guard isViewLoaded else { return .stop } return currentViewController.handleStatusBarTapped(xPosition: xPosition) } }