Generic fixes (#1191)

* check on the url validity before using it * handle tx nullability * add localization script to configure

Omar Hatem committed Nov 25, 2023 at 01:31 UTC fa25a4b2240bdd32170dee3944da88d0ce37d81b
3 files changed +4 -1
configure_cake_wallet_android.sh
+1
@@ -2,6 +2,7 @@ cd scripts/android
2 source ./app_env.sh cakewallet
3 ./app_config.sh
4 cd ../.. && flutter pub get
5 +flutter packages pub run tool/generate_localization.dart
6 cd cw_core && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
7 cd cw_monero && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
8 cd cw_bitcoin && flutter pub get && flutter packages pub run build_runner build --delete-conflicting-outputs && cd ..
cw_bitcoin/lib/electrum_wallet.dart
+1 -1
@@ -480,7 +480,7 @@ abstract class ElectrumWalletBase
480 unspentCoins = unspent.expand((e) => e).toList();
481 unspentCoins.forEach((coin) async {
482 final tx = await fetchTransactionInfo(hash: coin.hash, height: 0);
483 - coin.isChange = tx!.direction == TransactionDirection.outgoing;
483 + coin.isChange = tx?.direction == TransactionDirection.outgoing;
484 });
485
486 if (unspentCoinsInfo.isEmpty) {
lib/src/screens/wallet_connect/wc_connections_listing_view.dart
+2
@@ -31,6 +31,8 @@ class WalletConnectConnectionsView extends StatelessWidget {
31
32 final actualLinkList = launchUri.query.split("uri=");
33
34 + if (actualLinkList.length <= 1) return;
35 +
36 final query = actualLinkList[1];
37
38 final uri = Uri.decodeComponent(query);