aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/Models/Interface+Extension.swift
diff options
context:
space:
mode:
authorJeroen Leenarts <jeroen.leenarts@gmail.com>2018-08-16 22:03:40 +0200
committerJeroen Leenarts <jeroen.leenarts@gmail.com>2018-08-16 22:03:40 +0200
commit0adb454bd634388ba841dd938fc32493b42da0fe (patch)
tree227c3fae99937ecb6cb381d94de8c3be834f2208 /WireGuard/Models/Interface+Extension.swift
parentDisable warning for function body length. (diff)
downloadwireguard-apple-0adb454bd634388ba841dd938fc32493b42da0fe.tar.xz
wireguard-apple-0adb454bd634388ba841dd938fc32493b42da0fe.zip
Do not perform optional try, this ate errors in the addressess and DNS input.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to '')
-rw-r--r--WireGuard/Models/Interface+Extension.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/WireGuard/Models/Interface+Extension.swift b/WireGuard/Models/Interface+Extension.swift
index 735c7a2..98d0240 100644
--- a/WireGuard/Models/Interface+Extension.swift
+++ b/WireGuard/Models/Interface+Extension.swift
@@ -19,7 +19,7 @@ extension Interface {
throw InterfaceValidationError.invalidPrivateKey
}
- try? addresses?.commaSeparatedToArray().forEach { address in
+ try addresses?.commaSeparatedToArray().forEach { address in
do {
try _ = CIDRAddress(stringRepresentation: address)
} catch {
@@ -27,7 +27,7 @@ extension Interface {
}
}
- try? dns?.commaSeparatedToArray().forEach { address in
+ try dns?.commaSeparatedToArray().forEach { address in
do {
try _ = Endpoint(endpointString: address)
} catch {