aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard
diff options
context:
space:
mode:
authorRoopesh Chander <roop@roopc.net>2018-11-01 15:59:17 +0530
committerRoopesh Chander <roop@roopc.net>2018-11-01 15:59:17 +0530
commit1377153bc62a5afe9b98ea6793f900834432c15c (patch)
tree37e807ae731e0cf8c16b03dcbcb7d8f04288a261 /WireGuard
parentTunnel detail: Fix deletion of tunnel (diff)
downloadwireguard-apple-1377153bc62a5afe9b98ea6793f900834432c15c.tar.xz
wireguard-apple-1377153bc62a5afe9b98ea6793f900834432c15c.zip
Importing: Account for errors in showing the 'No configurations found' error
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to 'WireGuard')
-rw-r--r--WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift8
1 files changed, 4 insertions, 4 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
index 1d87b27..3ef672a 100644
--- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
+++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift
@@ -153,10 +153,6 @@ 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 {
@@ -170,6 +166,10 @@ class TunnelsListTableViewController: UITableViewController {
numberOfConfigFilesWithErrors = numberOfConfigFilesWithErrors + 1
}
}
+ guard (tunnelConfigurationsToAdd.count > 0) else {
+ showErrorAlert(title: "No configurations found", message: "Zip archive doesn't contain any valid .conf files")
+ return
+ }
var numberOfTunnelsRemainingAfterError = 0
tunnelsManager?.addMultiple(tunnelConfigurations: tunnelConfigurationsToAdd) { (numberOfTunnelsRemaining, error) in
if (error != nil) {