]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Importing: Show error when the zip file contains no .conf files
authorRoopesh Chander <roop@roopc.net>
Wed, 31 Oct 2018 20:34:26 +0000 (02:04 +0530)
committerRoopesh Chander <roop@roopc.net>
Thu, 1 Nov 2018 06:15:44 +0000 (11:45 +0530)
Signed-off-by: Roopesh Chander <roop@roopc.net>
WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift

index 3fa05f514551870ecbed63fcae56aa1a7874bff6..1b658544a14eb46da5867a1cfa1a15d0ffbabb16 100644 (file)
@@ -159,6 +159,10 @@ class TunnelsListTableViewController: UITableViewController {
             } catch (let error) {
                 print("Error opening zip archive: \(error)")
             }
+            guard (unarchivedFiles.count > 0) else {
+                showErrorAlert(title: "No configurations found", message: "Zip archive doesn't contain any .conf files")
+                return
+            }
             var numberOfConfigFilesWithErrors = 0
             var tunnelConfigurationsToAdd: [TunnelConfiguration] = []
             for unarchivedFile in unarchivedFiles {