From 5f0e03dc1bf95d107f0843e33a5492d23a5fbe4f Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 9 Dec 2022 14:55:04 -0600 Subject: [PATCH] add null check to epic wallet delete --- lib/services/coins/epiccash/epiccash_wallet.dart | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/services/coins/epiccash/epiccash_wallet.dart b/lib/services/coins/epiccash/epiccash_wallet.dart index fcf728fb8..65fcd1643 100644 --- a/lib/services/coins/epiccash/epiccash_wallet.dart +++ b/lib/services/coins/epiccash/epiccash_wallet.dart @@ -276,7 +276,16 @@ Future deleteEpicWallet({ final wallet = await secureStore.read(key: '${walletId}_wallet'); - return compute(_deleteWalletWrapper, wallet!); + if (wallet == null) { + return "Tried to delete non existent epic wallet file with walletId=$walletId"; + } else { + try { + return compute(_deleteWalletWrapper, wallet); + } catch (e, s) { + Logging.instance.log("$e\n$s", level: LogLevel.Error); + return "deleteEpicWallet($walletId) failed..."; + } + } } Future _initWalletWrapper(