Skip to content

Conversation

bergarces
Copy link
Contributor

@bergarces bergarces commented Mar 11, 2025

Explanation

CurrencyRateController was getting an unexpected error when the NetworkController.networkConfigurationsByChainId state included any configuration with nativeCurrency set as undefined.

The easiest way to prevent this error, as well as to avoid unnecessary results from the API that returns currency rates, is to filter out falsy values of nativeCurrency when updating currency rates.

References

Changelog

@metamask/assets-controllers

  • FIXED: Falsy values of nativeCurrency skipped when updating currency rates.

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've highlighted breaking changes using the "BREAKING" category above as appropriate
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

@bergarces bergarces marked this pull request as ready for review March 11, 2025 12:41
@bergarces bergarces requested a review from a team as a code owner March 11, 2025 12:41
salimtb
salimtb previously approved these changes Mar 25, 2025
@bergarces bergarces dismissed stale reviews from Prithpal-Sooriya and salimtb via 1281f46 March 25, 2025 09:55
@bergarces bergarces force-pushed the fix/MMASSETS-526-undefined-currency-error branch from 2988a56 to 1281f46 Compare March 25, 2025 09:55
@bergarces bergarces merged commit b9b6e96 into main Mar 25, 2025
193 checks passed
@bergarces bergarces deleted the fix/MMASSETS-526-undefined-currency-error branch March 25, 2025 10:09
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.

[Sentry] TypeError: undefined is not an object (evaluating 'y.toLowerCase')
3 participants