Skip to content

Commit

Permalink
Fix hostChainNameToName
Browse files Browse the repository at this point in the history
  • Loading branch information
adairrr committed Nov 26, 2024
1 parent ac78f55 commit ba39dbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/hip-turtles-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@abstract-money/core": patch
---

Ensure that hostChainNameToName doesn't throw
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export function hostChainNameToName(hostChainName: string) {
const chainName = chains.find(
({ chain_name, chain_id }) =>
chain_name === hostChainName ||
chainIdToHostChainName(chain_id) === hostChainName,
(chain_id && chainIdToHostChainName(chain_id) === hostChainName),
)?.chain_name
if (!chainName) {
throw new Error(`Chain not found by hostChain: ${hostChainName}`)
Expand Down

0 comments on commit ba39dbe

Please sign in to comment.