From 43779e42df725ad508789a4b05d637df4087a217 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 b77e8bc9..3dbb8993 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) {