forked from shadowfacts/Tusker
Fix crash if URLComponents.url is nil in instance selector
This commit is contained in:
parent
0de9a9fd37
commit
2ccec2f4df
|
@ -150,7 +150,8 @@ class InstanceSelectorTableViewController: UITableViewController {
|
||||||
private func updateSpecificInstance(domain: String) {
|
private func updateSpecificInstance(domain: String) {
|
||||||
activityIndicator.startAnimating()
|
activityIndicator.startAnimating()
|
||||||
|
|
||||||
guard let components = parseURLComponents(input: domain) else {
|
guard let components = parseURLComponents(input: domain),
|
||||||
|
let url = components.url else {
|
||||||
var snapshot = dataSource.snapshot()
|
var snapshot = dataSource.snapshot()
|
||||||
if snapshot.indexOfSection(.selected) != nil {
|
if snapshot.indexOfSection(.selected) != nil {
|
||||||
snapshot.deleteSections([.selected])
|
snapshot.deleteSections([.selected])
|
||||||
|
@ -159,7 +160,6 @@ class InstanceSelectorTableViewController: UITableViewController {
|
||||||
activityIndicator.stopAnimating()
|
activityIndicator.stopAnimating()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
let url = components.url!
|
|
||||||
|
|
||||||
let client = Client(baseURL: url, session: .appDefault)
|
let client = Client(baseURL: url, session: .appDefault)
|
||||||
let request = Client.getInstance()
|
let request = Client.getInstance()
|
||||||
|
|
Loading…
Reference in New Issue