]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Model: Ensure name is not empty
authorRoopesh Chander <roop@roopc.net>
Sun, 28 Oct 2018 12:42:18 +0000 (18:12 +0530)
committerRoopesh Chander <roop@roopc.net>
Sun, 28 Oct 2018 12:43:47 +0000 (18:13 +0530)
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>
WireGuard/WireGuard/Model/Configuration.swift

index d3d8b3566529350316008cc0bacd80d531de9697..3f9b5660dcc3c9108d0099c1da2bc0c483ecce8e 100644 (file)
@@ -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") }
     }
 }