macOS: Attempt to remove keychain item only if verified

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-04-04 15:29:25 +05:30
parent 6015661beb
commit adbe0b065e
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 {