Prevent crash on add and deletion of config.
This commit is contained in:
parent
5df512d4fe
commit
39990ab480
|
@ -328,6 +328,7 @@ extension AppCoordinator: TunnelsTableViewControllerDelegate {
|
|||
}
|
||||
|
||||
func connect(tunnel: Tunnel, tunnelsTableViewController: TunnelsTableViewController) {
|
||||
_ = refreshProviderManagers().then { () -> Promise<Void> in
|
||||
let manager = self.providerManager(for: tunnel)!
|
||||
let block = {
|
||||
switch manager.connection.status {
|
||||
|
@ -345,9 +346,13 @@ extension AppCoordinator: TunnelsTableViewControllerDelegate {
|
|||
} else {
|
||||
block()
|
||||
}
|
||||
|
||||
return Promise.value(())
|
||||
}
|
||||
}
|
||||
|
||||
func disconnect(tunnel: Tunnel, tunnelsTableViewController: TunnelsTableViewController) {
|
||||
_ = refreshProviderManagers().then { () -> Promise<Void> in
|
||||
let manager = self.providerManager(for: tunnel)!
|
||||
let block = {
|
||||
switch manager.connection.status {
|
||||
|
@ -365,6 +370,8 @@ extension AppCoordinator: TunnelsTableViewControllerDelegate {
|
|||
} else {
|
||||
block()
|
||||
}
|
||||
return Promise.value(())
|
||||
}
|
||||
}
|
||||
|
||||
private func connect(tunnel: Tunnel) {
|
||||
|
|
Loading…
Reference in New Issue