macOS: Attempt to remove keychain item only if verified

This commit is contained in:
Roopesh Chander 2019-04-04 15:29:25 +05:30
parent ae553ff316
commit d8d18fcb3d
1 changed files with 3 additions and 1 deletions

View File

@ -245,7 +245,9 @@ class TunnelsManager {
func remove(tunnel: TunnelContainer, completionHandler: @escaping (TunnelsManagerError?) -> Void) {
let tunnelProviderManager = tunnel.tunnelProvider
(tunnelProviderManager.protocolConfiguration as? NETunnelProviderProtocol)?.destroyConfigurationReference()
if tunnel.isTunnelConfigurationAvailableInKeychain {
(tunnelProviderManager.protocolConfiguration as? NETunnelProviderProtocol)?.destroyConfigurationReference()
}
tunnelProviderManager.removeFromPreferences { [weak self] error in
guard error == nil else {