diff --git a/breadwallet/src/ViewControllers/RootModals/SwapViewController.swift b/breadwallet/src/ViewControllers/RootModals/SwapViewController.swift index 02865e78..4f1d1d62 100644 --- a/breadwallet/src/ViewControllers/RootModals/SwapViewController.swift +++ b/breadwallet/src/ViewControllers/RootModals/SwapViewController.swift @@ -24,8 +24,8 @@ class SwapViewController : UIViewController, Subscriber, ModalPresentable, Track init( wm : BTCWalletManager, currency: CurrencyDef, select: String?) { self.currency = currency self.walletManager = wm - self.select = select - amountView = SwapAmountViewController(currency: currency, isPinPadExpandedAtLaunch: false, selected: select ?? "BTC") + self.select = (select==nil || select=="") ? "BTC": select! + amountView = SwapAmountViewController(currency: currency, isPinPadExpandedAtLaunch: false, selected: self.select!) refundWalletCell = AddressCell(currency: currency, noScan: true) refundWalletCellConstrainVisible = [] refundWalletCellConstrainHidden = [] diff --git a/breadwallet/src/ViewModels/BtcTransaction.swift b/breadwallet/src/ViewModels/BtcTransaction.swift index 20a5b617..a20d3057 100644 --- a/breadwallet/src/ViewModels/BtcTransaction.swift +++ b/breadwallet/src/ViewModels/BtcTransaction.swift @@ -78,12 +78,12 @@ struct WgrTransactionInfo { var eventDetailString : String { var ret = String.init(format: "%@ %@ - %@ %@", self.betEvent!.txHomeTeam, self.betEvent!.txHomeScore, self.betEvent!.txAwayScore, self.betEvent!.txAwayTeam) if explorerInfo != nil { - ret += String.init(format: "\nPrice: %.2f", (explorerInfo?.price!)!) + ret += String.init(format: "\nPrice: %.2f", (explorerInfo?.price ?? 0)!) if explorerInfo?.total != nil && Double((explorerInfo?.total)!)! > 0.0 { - ret += String.init(format: " Total: %@", (explorerInfo?.total!)!) + ret += String.init(format: " Total: %@", (explorerInfo?.total ?? 0)!) } - if explorerInfo?.spread != nil && Double((explorerInfo?.spread)!)! > 0.0 { - ret += String.init(format: " Spread: %@", (explorerInfo?.spread!)!) + if explorerInfo?.spread != nil && Double((explorerInfo?.spread)!)! != 0.0 { + ret += String.init(format: " Spread: %@", (explorerInfo?.spread ?? 0)!) } } return ret