mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
Fix: Check for destination_currencies property
Example stack:
TypeError: Cannot read property 'join' of undefined
at formatResponse
(ripple-lib/dist/npm/api/ledger/pathfind.js:75:187)
This commit is contained in:
@@ -84,7 +84,8 @@ function formatResponse(pathfind, paths) {
|
||||
const address = pathfind.source.address;
|
||||
return parsePathfind(address, pathfind.destination.amount, paths);
|
||||
}
|
||||
if (!_.includes(paths.destination_currencies,
|
||||
if (paths.destination_currencies !== undefined &&
|
||||
!_.includes(paths.destination_currencies,
|
||||
pathfind.destination.amount.currency)) {
|
||||
throw new NotFoundError('No paths found. ' +
|
||||
'The destination_account does not accept ' +
|
||||
|
||||
Reference in New Issue
Block a user