mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-25 19:55:52 +00:00
add null check to epic wallet delete
This commit is contained in:
parent
5f095249cb
commit
5f0e03dc1b
1 changed files with 10 additions and 1 deletions
|
@ -276,7 +276,16 @@ Future<String> deleteEpicWallet({
|
||||||
|
|
||||||
final wallet = await secureStore.read(key: '${walletId}_wallet');
|
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<String> _initWalletWrapper(
|
Future<String> _initWalletWrapper(
|
||||||
|
|
Loading…
Reference in a new issue