Do not perform optional try, this ate errors in the addressess and DNS input.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
d1223eb085
commit
0adb454bd6
|
@ -19,7 +19,7 @@ extension Interface {
|
||||||
throw InterfaceValidationError.invalidPrivateKey
|
throw InterfaceValidationError.invalidPrivateKey
|
||||||
}
|
}
|
||||||
|
|
||||||
try? addresses?.commaSeparatedToArray().forEach { address in
|
try addresses?.commaSeparatedToArray().forEach { address in
|
||||||
do {
|
do {
|
||||||
try _ = CIDRAddress(stringRepresentation: address)
|
try _ = CIDRAddress(stringRepresentation: address)
|
||||||
} catch {
|
} catch {
|
||||||
|
@ -27,7 +27,7 @@ extension Interface {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
try? dns?.commaSeparatedToArray().forEach { address in
|
try dns?.commaSeparatedToArray().forEach { address in
|
||||||
do {
|
do {
|
||||||
try _ = Endpoint(endpointString: address)
|
try _ = Endpoint(endpointString: address)
|
||||||
} catch {
|
} catch {
|
||||||
|
|
Loading…
Reference in New Issue