We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3974600 commit 927f1e7Copy full SHA for 927f1e7
packages/stellar_client/lib/src/client.dart
@@ -364,9 +364,15 @@ class Client {
364
}
365
throw Exception('Balance with asset code ${currency} not found.');
366
});
367
- // check that receiver account exists
368
- final balance = await getBalanceByAccountID(
369
- network: _network, accountId: destinationAddress);
+ List<BalanceInfo> balance = [];
+ try {
+ // check that receiver account exists
370
+ balance = await getBalanceByAccountID(
371
+ network: _network, accountId: destinationAddress);
372
+ } catch (e) {
373
+ throw Exception('Receiver account does not exist.');
374
+ }
375
+
376
// check that asset exists
377
var specificBalance = balance.firstWhere(
378
(balance) => balance.assetCode == currency,
0 commit comments