Fix crash showing custom instance on iOS 14

This commit is contained in:
Shadowfacts 2020-06-23 19:27:34 -04:00
parent a5a2cd147e
commit cf5b97d9c8
1 changed files with 3 additions and 1 deletions

View File

@ -118,7 +118,9 @@ class InstanceSelectorTableViewController: UITableViewController {
let request = Client.getInstance() let request = Client.getInstance()
client.run(request) { (response) in client.run(request) { (response) in
var snapshot = self.dataSource.snapshot() 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 case let .success(instance, _) = response {
if !snapshot.sectionIdentifiers.contains(.selected) { if !snapshot.sectionIdentifiers.contains(.selected) {