aboutsummaryrefslogtreecommitdiffstats
path: root/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
diff options
context:
space:
mode:
Diffstat (limited to 'WireGuard/WireGuard/ZipArchive/ZipExporter.swift')
-rw-r--r--WireGuard/WireGuard/ZipArchive/ZipExporter.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
index 33d62fd..052242a 100644
--- a/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
+++ b/WireGuard/WireGuard/ZipArchive/ZipExporter.swift
@@ -22,8 +22,8 @@ class ZipExporter {
var inputsToArchiver: [(fileName: String, contents: Data)] = []
var lastTunnelName: String = ""
for tunnelConfiguration in tunnelConfigurations {
- if let contents = WgQuickConfigFileWriter.writeConfigFile(from: tunnelConfiguration) {
- let name = tunnelConfiguration.interface.name
+ if let contents = tunnelConfiguration.asWgQuickConfig().data(using: .utf8) {
+ let name = tunnelConfiguration.interface.name ?? ""
if name.isEmpty || name == lastTunnelName { continue }
inputsToArchiver.append((fileName: "\(name).conf", contents: contents))
lastTunnelName = name