From e65ed3e7738b3bd2a5cbcb3f1bebcdef2e860b28 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Fri, 21 Jan 2022 11:09:55 -0500 Subject: [PATCH] Fix crash when ProfileHeaderView leaks --- Tusker/Views/Profile Header/ProfileHeaderView.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tusker/Views/Profile Header/ProfileHeaderView.swift b/Tusker/Views/Profile Header/ProfileHeaderView.swift index 3fc9bc6e..484c3a2d 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderView.swift +++ b/Tusker/Views/Profile Header/ProfileHeaderView.swift @@ -181,7 +181,8 @@ class ProfileHeaderView: UIView { } @objc private func updateUIForPreferences() { - guard let account = mastodonController.persistentContainer.account(for: accountID) else { + guard let mastodonController = mastodonController, + let account = mastodonController.persistentContainer.account(for: accountID) else { fatalError("Missing cached account \(accountID!)") }