aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/Model
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-10-28 18:12:18 +0530
committerRoopesh Chander <roop@roopc.net>2018-10-28 18:13:47 +0530
commit3d4409fc93ac98eacaac356d26d798e38f43153b (patch)
treedd8b3e6057058f5d5fdc76c3f85d247d7311d6d7 /WireGuard/WireGuard/Model
parentVPN: A tunnel may be already active on app startup (diff)
downloadwireguard-apple-3d4409fc93ac98eacaac356d26d798e38f43153b.tar.xz
wireguard-apple-3d4409fc93ac98eacaac356d26d798e38f43153b.zip
Model: Ensure name is not empty
We don't need it because we don't have to open the new-config UI after scanning a QR code. This reverts commit db72e95. Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard/WireGuard/Model')
-rw-r--r--WireGuard/WireGuard/Model/Configuration.swift1
1 files changed, 1 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/Model/Configuration.swift b/WireGuard/WireGuard/Model/Configuration.swift
index d3d8b35..3f9b566 100644
--- a/WireGuard/WireGuard/Model/Configuration.swift
+++ b/WireGuard/WireGuard/Model/Configuration.swift
@@ -28,6 +28,7 @@ struct InterfaceConfiguration: Codable {
init(name: String, privateKey: Data) {
self.name = name
self.privateKey = privateKey
+ if (name.isEmpty) { fatalError("Empty name") }
if (privateKey.count != 32) { fatalError("Invalid private key") }
}
}