Skip to content

prevent crash from missing account#8604

Merged
bergarces merged 3 commits intomainfrom
prevent-crash-from-missing-account
Apr 28, 2026
Merged

prevent crash from missing account#8604
bergarces merged 3 commits intomainfrom
prevent-crash-from-missing-account

Conversation

@bergarces
Copy link
Copy Markdown
Contributor

@bergarces bergarces commented Apr 28, 2026

Explanation

Stop crash that occurs when there is a missing entry in the internalAccount object.

https://metamask.sentry.io/issues/7394639158/?project=273505&query=is%3Aunresolved%20Cannot%20read%20properties%20of%20undefined&referrer=issue-stream
https://metamask.sentry.io/issues/6977774458/?project=273505&query=is%3Aunresolved%20Cannot%20read%20properties%20of%20undefined&referrer=issue-stream

References

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 communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

Note

Low Risk
Small defensive change in a selector plus a unit test; behavior only changes for inconsistent state where an account ID is missing.

Overview
Prevents selectAssetsBySelectedAccountGroup from crashing when an accountTree group references an account ID that is missing from internalAccounts by skipping those entries during account mapping.

Adds a regression test covering the missing-account scenario and documents the fix in the assets-controllers changelog.

Reviewed by Cursor Bugbot for commit 78aa9aa. Bugbot is set up for automated code reviews on this repo. Configure here.

@bergarces bergarces requested a review from a team as a code owner April 28, 2026 07:48
@bergarces bergarces requested a review from a team as a code owner April 28, 2026 07:52
@bergarces bergarces enabled auto-merge April 28, 2026 08:00
@bergarces bergarces added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit fac6fa1 Apr 28, 2026
362 checks passed
@bergarces bergarces deleted the prevent-crash-from-missing-account branch April 28, 2026 08:08
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.

2 participants