From 0fa87e917798e162f6d712e275138f856637fac1 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 23 Jun 2020 22:21:50 -0400 Subject: [PATCH] Prevent crash when displaying accounts with no pinned statuses --- Tusker/Screens/Profile/ProfileTableViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/Tusker/Screens/Profile/ProfileTableViewController.swift b/Tusker/Screens/Profile/ProfileTableViewController.swift index 33befb6ca5..b8d84b8f94 100644 --- a/Tusker/Screens/Profile/ProfileTableViewController.swift +++ b/Tusker/Screens/Profile/ProfileTableViewController.swift @@ -109,6 +109,7 @@ class ProfileTableViewController: EnhancedTableViewController { getStatuses(onlyPinned: true) { (response) in guard case let .success(statuses, _) = response else { fatalError() } + if statuses.isEmpty { return } self.mastodonController.persistentContainer.addAll(statuses: statuses) { self.pinnedStatuses = statuses.map { ($0.id, .unknown) }