Skip to content

Commit

Permalink
Merge pull request #220 from nautls/fix-empty-array-bug
Browse files Browse the repository at this point in the history
Fix `Empty Array` bug
  • Loading branch information
arobsn authored Nov 26, 2024
2 parents 3bcb365 + 25a0504 commit 4019e8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chains/ergo/addresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function getChangeAddress(
.map((o) => addressFromErgoTree(o.ergoTree))
.filter((a) => ownAddresses.includes(a));

return last(addresses);
if (addresses.length) return last(addresses);
}

export function addressFromPk(pk: string) {
Expand Down

0 comments on commit 4019e8d

Please sign in to comment.