-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix: Add optional chaining to currencyRates check for stability #28753
fix: Add optional chaining to currencyRates check for stability #28753
Conversation
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Builds ready [24c2ecd]
Page Load Metrics (1725 ± 98 ms)
Bundle size diffs
|
? currencyRates[networkConfigurationsByChainId[chainId].nativeCurrency] | ||
.conversionRate | ||
? currencyRates?.[networkConfigurationsByChainId[chainId]?.nativeCurrency] | ||
?.conversionRate | ||
: conversionRate; |
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.
Were you able to repro the linked issue locally?
From the error linked in the issue i think this optional chaining makes sense
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 wasn't able to reproduce exactly, but I've definitely seen similar bugs from time to time related to currencyRates not yet resolving.
LGTM ✅ I couldn't reproduce the issue, but the safe accessor will help us prevent this error. |
Description
#28750
Related issues
Fixes: #28750
Manual testing steps
Testing steps in issue. Behavior is inconsistent, hard to replicate consistently.
Screenshots/Recordings
Pre-merge author checklist
Pre-merge reviewer checklist