From 193b8c25969d9d388a77dece0b4f06691e7de781 Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Thu, 1 Nov 2018 02:04:26 +0530 Subject: [PATCH] Importing: Show error when the zip file contains no .conf files Signed-off-by: Roopesh Chander --- .../WireGuard/UI/iOS/TunnelsListTableViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) 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 {