Prevent crash when displaying accounts with no pinned statuses

This commit is contained in:
Shadowfacts 2020-06-23 22:21:50 -04:00
parent 5cb84e271a
commit 0fa87e9177
1 changed files with 1 additions and 0 deletions

View File

@ -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) }