diff options
author | Roopesh Chander <roop@roopc.net> | 2018-10-25 06:58:14 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-10-27 15:13:02 +0530 |
commit | 11876574979e42b18824f65cc64522431bcd4f1d (patch) | |
tree | 342e53e7884beb7fb24ca7f94494e6713fbcf36e /WireGuard/WireGuard/UI | |
parent | Info.plist: support for opening wg-quick config (.conf) files (diff) | |
download | wireguard-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.swift | 2 |
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") } |