From d37e230ee08c52aa04e294e6f122a13b488a174f Mon Sep 17 00:00:00 2001 From: Roopesh Chander Date: Tue, 22 Jan 2019 04:54:32 +0530 Subject: macOS: Fix crash when importing using NoTunnelsDetailVC's button Signed-off-by: Roopesh Chander --- .../UI/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) } } -- cgit v1.2.3-59-g8ed1b