From e2b068af1a67a6d352138c2e397b347e13a84cc3 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 21 Jan 2019 23:21:47 +0100 Subject: macOS: Tunnel edit: actually clean up error handling Signed-off-by: Jason A. Donenfeld --- .../UI/macOS/ViewController/TunnelEditViewController.swift | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift index 78c2bcc..7a6a4a0 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/TunnelEditViewController.swift @@ -218,11 +218,11 @@ class TunnelEditViewController: NSViewController { tunnelsManager.add(tunnelConfiguration: tunnelConfiguration, activateOnDemandSetting: onDemandSetting) { [weak self] result in if let error = result.error { ErrorPresenter.showErrorAlert(error: error, from: self) - } else { - let tunnel: TunnelContainer = result.value! - self?.dismiss(self) - self?.delegate?.tunnelSaved(tunnel: tunnel) + return } + let tunnel: TunnelContainer = result.value! + self?.dismiss(self) + self?.delegate?.tunnelSaved(tunnel: tunnel) } } } -- cgit v1.2.3-59-g8ed1b