From 986fc5b833350b79eecb782138bf4babe6cd35c7 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 33befb6c..b8d84b8f 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) }