aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/UI
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-25 06:58:14 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-27 15:13:02 +0530
commit11876574979e42b18824f65cc64522431bcd4f1d (patch)
tree342e53e7884beb7fb24ca7f94494e6713fbcf36e /WireGuard/WireGuard/UI
parentInfo.plist: support for opening wg-quick config (.conf) files (diff)
downloadwireguard-apple-11876574979e42b18824f65cc64522431bcd4f1d.tar.xz
wireguard-apple-11876574979e42b18824f65cc64522431bcd4f1d.zip
Model: Allow creating an interface with empty name
But don't allow such a tunnel to be added to the tunnel manager. (We'll need to create an interface with an empty name when we're reading QR codes.) Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/UI')
-rw-r--r--WireGuard/WireGuard/UI/TunnelViewModel.swift2
1 files changed, 1 insertions, 1 deletions
diff --git a/WireGuard/WireGuard/UI/TunnelViewModel.swift b/WireGuard/WireGuard/UI/TunnelViewModel.swift
index bc826d5..e5c814f 100644
--- a/WireGuard/WireGuard/UI/TunnelViewModel.swift
+++ b/WireGuard/WireGuard/UI/TunnelViewModel.swift
@@ -98,7 +98,7 @@ class TunnelViewModel {
func save() -> SaveResult<InterfaceConfiguration> {
fieldsWithError.removeAll()
- guard let name = scratchpad[.name] else {
+ guard let name = scratchpad[.name], (!name.isEmpty) else {
fieldsWithError.insert(.name)
return .error("Interface name is required")
}