-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Prevent Undefined address in useWalletClient Calls #243
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think throwing here is the right approach - are you running into a scenario where this is undefined?
If you are, we might need to update this to wait on running the subsequent logic until the useGlobalWalletSignerAccount query is resolved.
I actually did run into a case where That said, if waiting for |
Yes, lets update it so the |
Lets fix it. |
I fixed a potential issue where
address
could beundefined
when passed touseWalletClient
.Now, before using
address
, the code explicitly checks its existence:address
is missing, an error is thrown:'No address found for the global wallet signer.'
PR-Codex overview
This PR enhances the
useGlobalWalletSignerClient
function by adding error handling to ensure that a valid wallet address is available before proceeding with the wallet client setup.Detailed summary
address
variable.address
is not found, an error is thrown with the message: 'No address found for the global wallet signer.'