From: Jason A. Donenfeld Date: Mon, 21 Jan 2019 22:21:47 +0000 (+0100) Subject: macOS: Tunnel edit: actually clean up error handling X-Git-Tag: 0.0.20190207-1~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2b068af1a67a6d352138c2e397b347e13a84cc3;p=thirdparty%2Fwireguard-apple.git macOS: Tunnel edit: actually clean up error handling Signed-off-by: Jason A. Donenfeld --- 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) } } }