From 7c1c1cba7dcdb513e15e81494e697a54a9aeeab7 Mon Sep 17 00:00:00 2001 From: sneurlax Date: Thu, 12 Oct 2023 14:32:01 -0500 Subject: [PATCH] update ref and throw on null addr (addr!.publicKey throws) --- fusiondart | 2 +- lib/services/mixins/fusion_wallet_interface.dart | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fusiondart b/fusiondart index c7e9521a0..2908a9599 160000 --- a/fusiondart +++ b/fusiondart @@ -1 +1 @@ -Subproject commit c7e9521a03aa8e6e0b11134027d6ea301acbc273 +Subproject commit 2908a9599c0f15e04e14d90e3303bb84e83de121 diff --git a/lib/services/mixins/fusion_wallet_interface.dart b/lib/services/mixins/fusion_wallet_interface.dart index d59dde39a..ffd5503ab 100644 --- a/lib/services/mixins/fusion_wallet_interface.dart +++ b/lib/services/mixins/fusion_wallet_interface.dart @@ -287,14 +287,18 @@ mixin FusionWalletInterface { for (final utxo in walletUtxos) { // Check if address is available. if (utxo.address == null) { - // A utxo object should always have a non null address - // as per the db query above + // A utxo object should always have a non null address. throw Exception("UTXO ${utxo.txid}:${utxo.vout} address is null"); } // Find public key. final addr = await _db.getAddress(_walletId, utxo.address!); + if (addr == null) { + // A utxo object should always have a non null address. + throw Exception("UTXO ${utxo.txid}:${utxo.vout} address not found"); + } + final dto = fusion.UtxoDTO( txid: utxo.txid, vout: utxo.vout,