aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift2
-rw-r--r--WireGuard/WireGuard/VPN/TunnelsManager.swift2
-rw-r--r--WireGuard/WireGuard/WireGuardAppError.swift2
-rw-r--r--WireGuard/WireGuard/ZipArchive/ZipArchive.swift2
-rw-r--r--WireGuard/WireGuard/ZipArchive/ZipExporter.swift2
-rw-r--r--WireGuard/WireGuard/ZipArchive/ZipImporter.swift2
6 files changed, 6 insertions, 6 deletions
diff --git a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift
index 3c4a1bf..c613d67 100644
--- a/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift
+++ b/WireGuard/WireGuard/UI/iOS/ErrorPresenter.swift
@@ -8,7 +8,7 @@ class ErrorPresenter {
static func showErrorAlert(error: WireGuardAppError, from sourceVC: UIViewController?,
onDismissal: (() -> Void)? = nil, onPresented: (() -> Void)? = nil) {
guard let sourceVC = sourceVC else { return }
- let (title, message) = error.alertText()
+ guard let (title, message) = error.alertText() else { return }
let okAction = UIAlertAction(title: "OK", style: .default) { (_) in
onDismissal?()
}
diff --git a/WireGuard/WireGuard/VPN/TunnelsManager.swift b/WireGuard/WireGuard/VPN/TunnelsManager.swift
index b36c9f8..9d04e1f 100644
--- a/WireGuard/WireGuard/VPN/TunnelsManager.swift
+++ b/WireGuard/WireGuard/VPN/TunnelsManager.swift
@@ -31,7 +31,7 @@ enum TunnelsManagerError: WireGuardAppError {
case tunnelActivationFailedInternalError // startTunnel() succeeded, but activation failed
case tunnelActivationFailedNoInternetConnection // startTunnel() succeeded, but activation failed since no internet
- func alertText() -> (String, String) {
+ func alertText() -> (String, String)? {
switch (self) {
case .tunnelNameEmpty:
return ("No name provided", "Can't create tunnel with an empty name")
diff --git a/WireGuard/WireGuard/WireGuardAppError.swift b/WireGuard/WireGuard/WireGuardAppError.swift
index 5289633..3e4707d 100644
--- a/WireGuard/WireGuard/WireGuardAppError.swift
+++ b/WireGuard/WireGuard/WireGuardAppError.swift
@@ -2,5 +2,5 @@
// Copyright © 2018 WireGuard LLC. All Rights Reserved.
protocol WireGuardAppError: Error {
- func alertText() -> (/* title */ String, /* message */ String)
+ func alertText() -> (/* title */ String, /* message */ String)?
}
diff --git a/WireGuard/WireGuard/ZipArchive/ZipArchive.swift b/WireGuard/WireGuard/ZipArchive/ZipArchive.swift
index fe633d0..a849daa 100644
--- a/WireGuard/WireGuard/ZipArchive/ZipArchive.swift
+++ b/WireGuard/WireGuard/ZipArchive/ZipArchive.swift
@@ -8,7 +8,7 @@ enum ZipArchiveError: WireGuardAppError {
case cantOpenOutputZipFileForWriting
case badArchive
- func alertText() -> (String, String) {
+ func alertText() -> (String, String)? {
switch (self) {
case .cantOpenInputZipFile:
return ("Unable to read zip archive", "The zip archive could not be read.")
diff --git a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
index a4e9d7a..4f57613 100644
--- a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
+++ b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
@@ -6,7 +6,7 @@ import UIKit
enum ZipExporterError: WireGuardAppError {
case noTunnelsToExport
- func alertText() -> (String, String) {
+ func alertText() -> (String, String)? {
switch (self) {
case .noTunnelsToExport:
return ("Nothing to export", "There are no tunnels to export")
diff --git a/WireGuard/WireGuard/ZipArchive/ZipImporter.swift b/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
index 507a823..d281fb6 100644
--- a/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
+++ b/WireGuard/WireGuard/ZipArchive/ZipImporter.swift
@@ -6,7 +6,7 @@ import UIKit
enum ZipImporterError: WireGuardAppError {
case noTunnelsInZipArchive
- func alertText() -> (String, String) {
+ func alertText() -> (String, String)? {
switch (self) {
case .noTunnelsInZipArchive:
return ("No tunnels in zip archive", "No .conf tunnel files were found inside the zip archive.")