From 0ae014976b92b7cfd622ec6e27e42786d5960afd Mon Sep 17 00:00:00 2001 From: Chung Tran Date: Thu, 4 Jan 2024 13:02:48 +0700 Subject: [PATCH] fix: safer method --- .../Scenes/Main/Crypto/Container/CryptoCoordinator.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/p2p_wallet/Scenes/Main/Crypto/Container/CryptoCoordinator.swift b/p2p_wallet/Scenes/Main/Crypto/Container/CryptoCoordinator.swift index 8bdb96383c..0ff1d39a3f 100644 --- a/p2p_wallet/Scenes/Main/Crypto/Container/CryptoCoordinator.swift +++ b/p2p_wallet/Scenes/Main/Crypto/Container/CryptoCoordinator.swift @@ -188,7 +188,7 @@ final class CryptoCoordinator: Coordinator { private func showUserAction(userAction: any UserAction) { coordinate(to: TransactionDetailCoordinator( viewModel: .init(userAction: userAction), - presentingViewController: navigationController.parent! + presentingViewController: navigationController.parent ?? navigationController )) .sink(receiveValue: { _ in }) .store(in: &subscriptions) @@ -196,7 +196,7 @@ final class CryptoCoordinator: Coordinator { private func showSendTransactionStatus(model: SendTransaction) { coordinate(to: SendTransactionStatusCoordinator( - parentController: navigationController.parent!, + parentController: navigationController.parent ?? navigationController, transaction: model )) .sink(receiveValue: {})