aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-25 15:50:27 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-27 15:13:02 +0530
commitc8fba951ad3b6379baba6cb4468aa709d9e8e478 (patch)
treee19755c346c9cc189ac2f2d61615d224497ec747 /WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
parentImport: Support for importing a config file from file providers (diff)
downloadwireguard-apple-c8fba951ad3b6379baba6cb4468aa709d9e8e478.tar.xz
wireguard-apple-c8fba951ad3b6379baba6cb4468aa709d9e8e478.zip
VPN: Adding, modifying and deleting actual NETunnelProviderManager instances
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift6
1 files changed, 4 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
index e155a61..fdd42d4 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelEditTableViewController.swift
@@ -34,7 +34,7 @@ class TunnelEditTableViewController: UITableViewController {
// Use this initializer to edit an existing tunnel.
tunnelsManager = tm
tunnel = t
- tunnelViewModel = TunnelViewModel(tunnelConfiguration: t.tunnelConfiguration)
+ tunnelViewModel = TunnelViewModel(tunnelConfiguration: t.tunnelConfiguration())
super.init(style: .grouped)
}
@@ -92,7 +92,9 @@ class TunnelEditTableViewController: UITableViewController {
self?.showErrorAlert(title: "Could not save", message: "Internal error")
} else {
self?.dismiss(animated: true, completion: nil)
- self?.delegate?.tunnelSaved(tunnel: tunnel)
+ if let tunnel = tunnel {
+ self?.delegate?.tunnelSaved(tunnel: tunnel)
+ }
}
}
}