Skip to content

fix: throw if address for chainId is missing#704

Merged
yingyangxu2026 merged 1 commit into
storyprotocol:mainfrom
Ocheretovich:main
Mar 10, 2026
Merged

fix: throw if address for chainId is missing#704
yingyangxu2026 merged 1 commit into
storyprotocol:mainfrom
Ocheretovich:main

Conversation

@Ocheretovich
Copy link
Copy Markdown
Contributor

Prevent getAddress from returning undefined when a mapping for the given chainId is missing. Adds a small fail-fast guard to throw an explicit error instead of returning an undefined address.

@yingyangxu2026
Copy link
Copy Markdown
Collaborator

Thank you for your interest in our project. I'm curious why you're interested in this part of the code? This section of code is not exposed to users, and internally we will not map chainId to invalid addresses.

@Ocheretovich
Copy link
Copy Markdown
Contributor Author

While reviewing the code I noticed that address[chainId] could return undefined. Throwing an explicit error felt safer than silently returning an undefined value.

@yingyangxu2026
Copy link
Copy Markdown
Collaborator

get it, I will communicate with other to decide whether merge the PR.

@yingyangxu2026
Copy link
Copy Markdown
Collaborator

@Ocheretovich Commits must have verified signatures.

Signed-off-by: Ocheretovich Oksana <ocheretovich@gmail.com>
@Ocheretovich
Copy link
Copy Markdown
Contributor Author

@yingyangxu2026 signed and force-pushed the commit

@yingyangxu2026 yingyangxu2026 merged commit ede916f into storyprotocol:main Mar 10, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants