From cf5b97d9c8c40ae05d6edd650b79b330002106ed Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 23 Jun 2020 19:27:34 -0400 Subject: [PATCH] Fix crash showing custom instance on iOS 14 --- .../Onboarding/InstanceSelectorTableViewController.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift b/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift index b77e8bc9d1..3dbb8993a6 100644 --- a/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift +++ b/Tusker/Screens/Onboarding/InstanceSelectorTableViewController.swift @@ -118,7 +118,9 @@ class InstanceSelectorTableViewController: UITableViewController { let request = Client.getInstance() client.run(request) { (response) in var snapshot = self.dataSource.snapshot() - snapshot.deleteItems(snapshot.itemIdentifiers(inSection: .selected)) + if snapshot.indexOfSection(.selected) != nil { + snapshot.deleteItems(snapshot.itemIdentifiers(inSection: .selected)) + } if case let .success(instance, _) = response { if !snapshot.sectionIdentifiers.contains(.selected) {