diff options
author | Roopesh Chander <roop@roopc.net> | 2018-11-01 02:04:26 +0530 |
---|---|---|
committer | Roopesh Chander <roop@roopc.net> | 2018-11-01 11:45:44 +0530 |
commit | 193b8c25969d9d388a77dece0b4f06691e7de781 (patch) | |
tree | e4dddd1dc28458b73a001b5af17703270b9c388f /WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | |
parent | VPN: We have to start observing the tunnelContainer before we attempt to activate it (diff) | |
download | wireguard-apple-193b8c25969d9d388a77dece0b4f06691e7de781.tar.xz wireguard-apple-193b8c25969d9d388a77dece0b4f06691e7de781.zip |
Importing: Show error when the zip file contains no .conf files
Signed-off-by: Roopesh Chander <roop@roopc.net>
Diffstat (limited to '')
-rw-r--r-- | WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift index 3fa05f5..1b65854 100644 --- a/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift +++ b/WireGuard/WireGuard/UI/iOS/TunnelsListTableViewController.swift @@ -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 { |