From 21e4828a7213f03fa0a47c8c91ef2d44f4766fbd Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 9 May 2021 21:48:59 -0400 Subject: [PATCH] Fix crash when notifications fail to load --- .../Notifications/NotificationsTableViewController.swift | 5 ++++- Tusker/Screens/Profile/ProfileStatusesViewController.swift | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Notifications/NotificationsTableViewController.swift b/Tusker/Screens/Notifications/NotificationsTableViewController.swift index 24e67261..ab5b59c2 100644 --- a/Tusker/Screens/Notifications/NotificationsTableViewController.swift +++ b/Tusker/Screens/Notifications/NotificationsTableViewController.swift @@ -57,7 +57,10 @@ class NotificationsTableViewController: TimelineLikeTableViewController Void) { let request = Client.getNotifications(excludeTypes: excludedTypes) mastodonController.run(request) { (response) in - guard case let .success(notifications, pagination) = response else { fatalError() } + guard case let .success(notifications, pagination) = response else { + completion([]) + return + } let groups = NotificationGroup.createGroups(notifications: notifications, only: self.groupTypes) diff --git a/Tusker/Screens/Profile/ProfileStatusesViewController.swift b/Tusker/Screens/Profile/ProfileStatusesViewController.swift index d1b73e46..2934acd8 100644 --- a/Tusker/Screens/Profile/ProfileStatusesViewController.swift +++ b/Tusker/Screens/Profile/ProfileStatusesViewController.swift @@ -99,6 +99,7 @@ class ProfileStatusesViewController: TimelineLikeTableViewController