From d1127adac27b21022426379f94245e0ac8028a0f Mon Sep 17 00:00:00 2001 From: Andrej Mihajlov Date: Thu, 12 Oct 2023 14:18:10 +0200 Subject: [PATCH] Prevent logging error when settings are not found in Keychain --- .../TunnelManager/LoadTunnelConfigurationOperation.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ios/MullvadVPN/TunnelManager/LoadTunnelConfigurationOperation.swift b/ios/MullvadVPN/TunnelManager/LoadTunnelConfigurationOperation.swift index 74881d49694d..d4c86a74f101 100644 --- a/ios/MullvadVPN/TunnelManager/LoadTunnelConfigurationOperation.swift +++ b/ios/MullvadVPN/TunnelManager/LoadTunnelConfigurationOperation.swift @@ -61,7 +61,8 @@ class LoadTunnelConfigurationOperation: ResultOperation { private func readSettings() -> Result { Result { try SettingsManager.readSettings() } .flatMapError { error in - if let error = error as? KeychainError, error == .itemNotFound { + if let error = error as? ReadSettingsVersionError, + let keychainError = error.underlyingError as? KeychainError, keychainError == .itemNotFound { logger.debug("Settings not found in keychain.") return .success(nil)