add null check to epic wallet delete

This commit is contained in:
julian 2022-12-09 14:55:04 -06:00
parent 5f095249cb
commit 5f0e03dc1b

View file

@ -276,7 +276,16 @@ Future<String> 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<String> _initWalletWrapper(