From c7b708e62ba7a331698a0a5dfac2f124be09fe66 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 14 Dec 2020 22:23:22 -0500 Subject: [PATCH] Fix crash when sidebar collapses --- Tusker/Screens/Profile/ProfileViewController.swift | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Tusker/Screens/Profile/ProfileViewController.swift b/Tusker/Screens/Profile/ProfileViewController.swift index 0653acb7..08347e4d 100644 --- a/Tusker/Screens/Profile/ProfileViewController.swift +++ b/Tusker/Screens/Profile/ProfileViewController.swift @@ -78,8 +78,6 @@ class ProfileViewController: UIPageViewController { } navigationItem.rightBarButtonItem = composeButton - userActivity = UserActivityManager.showProfileActivity(id: accountID!, accountID: mastodonController.accountInfo!.id) - headerView = ProfileHeaderView.create() headerView.delegate = self @@ -132,6 +130,10 @@ class ProfileViewController: UIPageViewController { return } + if let currentAccountID = mastodonController.accountInfo?.id { + userActivity = UserActivityManager.showProfileActivity(id: accountID, accountID: currentAccountID) + } + // Optionally invoke updateUI on headerView because viewDidLoad may not have been called yet headerView?.updateUI(for: accountID) navigationItem.title = account.displayNameWithoutCustomEmoji