Ensure that all tunnel names are trimmed of whitespaces

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander
2018-11-03 15:45:29 +05:30
parent ac79c5b1f7
commit 366ca7802a
3 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -97,7 +97,7 @@ class TunnelViewModel {
func save() -> SaveResult<InterfaceConfiguration> {
fieldsWithError.removeAll()
guard let name = scratchpad[.name], (!name.isEmpty) else {
guard let name = scratchpad[.name]?.trimmingCharacters(in: .whitespacesAndNewlines), (!name.isEmpty) else {
fieldsWithError.insert(.name)
return .error("Interface name is required")
}