Fix crash if URLComponents.url is nil in instance selector

This commit is contained in:
Shadowfacts 2023-10-28 13:47:44 -05:00
parent 0de9a9fd37
commit 2ccec2f4df
1 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,8 @@ class InstanceSelectorTableViewController: UITableViewController {
private func updateSpecificInstance(domain: String) {
activityIndicator.startAnimating()
guard let components = parseURLComponents(input: domain) else {
guard let components = parseURLComponents(input: domain),
let url = components.url else {
var snapshot = dataSource.snapshot()
if snapshot.indexOfSection(.selected) != nil {
snapshot.deleteSections([.selected])
@ -159,7 +160,6 @@ class InstanceSelectorTableViewController: UITableViewController {
activityIndicator.stopAnimating()
return
}
let url = components.url!
let client = Client(baseURL: url, session: .appDefault)
let request = Client.getInstance()