From d056732e2705b51d02bf3ef938df9eec6fbe268d Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Tue, 22 Jan 2019 04:54:32 +0530 Subject: [PATCH] macOS: Fix crash when importing using NoTunnelsDetailVC's button --- .../macOS/ViewController/NoTunnelsDetailViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WireGuard/WireGuard/UI/macOS/ViewController/NoTunnelsDetailViewController.swift b/WireGuard/WireGuard/UI/macOS/ViewController/NoTunnelsDetailViewController.swift index 38bef87..49f6197 100644 --- a/WireGuard/WireGuard/UI/macOS/ViewController/NoTunnelsDetailViewController.swift +++ b/WireGuard/WireGuard/UI/macOS/ViewController/NoTunnelsDetailViewController.swift @@ -40,6 +40,7 @@ class NoTunnelsDetailViewController: NSViewController { } @objc func importTunnelClicked() { - ImportPanelPresenter.presentImportPanel(tunnelsManager: tunnelsManager, sourceVC: self) + // We pass sourceVC as parent instead of self because this VC will not be visible when the import completes + ImportPanelPresenter.presentImportPanel(tunnelsManager: tunnelsManager, sourceVC: parent) } }