From d62691d6f9975db74f02359bd61ddf1dad76dfd9 Mon Sep 17 00:00:00 2001
From: poka <poka@p2p.legal>
Date: Fri, 10 Jun 2022 19:26:46 +0200
Subject: [PATCH] fix: null balance deleting check

---
 lib/screens/myWallets/wallet_options.dart | 3 ++-
 pubspec.yaml                              | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/screens/myWallets/wallet_options.dart b/lib/screens/myWallets/wallet_options.dart
index e0de4385..73c1d8c9 100644
--- a/lib/screens/myWallets/wallet_options.dart
+++ b/lib/screens/myWallets/wallet_options.dart
@@ -500,7 +500,8 @@ class WalletOptions extends StatelessWidget {
               _hasConsumers.hasError) {
             return const Text('');
           }
-          final double _balance = balanceCache[walletProvider.address.text]!;
+          final double _balance =
+              balanceCache[walletProvider.address.text] ?? 0;
           final bool canDelete = !isDefaultWallet &&
               !_hasConsumers.data! &&
               (_balance > 2 || _balance == 0);
diff --git a/pubspec.yaml b/pubspec.yaml
index 3becc8a5..f08d96cf 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -5,7 +5,7 @@ description: Pay with G1.
 # pub.dev using `pub publish`. This is preferred for private packages.
 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 
-version: 0.0.8+6
+version: 0.0.8+7
 
 environment:
   sdk: '>=2.12.0 <3.0.0'
-- 
GitLab