Skip to content
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

[Bug]: Cannot convert undefined or null to object #26243

Closed
egorFiNE opened this issue Jul 31, 2024 · 5 comments · Fixed by #26264
Closed

[Bug]: Cannot convert undefined or null to object #26243

egorFiNE opened this issue Jul 31, 2024 · 5 comments · Fixed by #26264
Labels
external-contributor regression-prod-12.0.0 Regression bug that was found in production in release 12.0.0 release-12.3.0 Issue or pull request that will be included in release 12.3.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-assets type-bug

Comments

@egorFiNE
Copy link

Describe the bug

Sending USDT on BSC to an address crashes MetaMask and makes it unusable even after the restart. I have sent USDT countless times on BSC before so that's a regression of v12.

The way to reset MetaMask is to restart chrome, switch MetaMask to another network, Reset activity, then back to BSC and again Reset activity and only after that I can use MetaMask again.

Bug is 100% repeatable.

Expected behavior

No response

Screenshots/Recordings

Screenshot 2024-07-31 at 11 25 39

Steps to reproduce

  1. Open metamask, enter password
  2. Go to Tokens tab
  3. Select USDT
  4. Click Send
  5. Choose address in Contacts
  6. Enter a positive amount
  7. Click Continue

Boom, Cannot convert undefined or null to object

Error messages or log output

MetaMask encountered an error
Try again by closing and reopening the popup, or contact support here.
Error details
Message: Cannot convert undefined or null to object

Code: TypeError

Stack:
TypeError: Cannot convert undefined or null to object
  at Function.entries (<anonymous>)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-9.js:1:204169
  at e.<computed> (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/sentry-install.js:1:681)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:252205
  at e.<computed> (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/scripts/sentry-install.js:1:681)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:251529
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:180624
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:181223
  at g (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/ui-7.js:1:108263)
  at ga (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:61316)
  at Cs (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:106147)
  at Au (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:92055)
  at Ou (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:91980)
  at Tu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:89328)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:47726
  at n.unstable_runWithPriority (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:3:13158)
  at Yi (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:47435)
  at eo (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:47671)
  at Ji (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:47606)
  at $u (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:104354)
  at n.unstable_runWithPriority (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:3:13158)
  at Yi (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:47435)
  at Bu (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:104005)
  at chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:1:103916
  at B (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:3:12540)
  at T.port1.onmessage (chrome-extension://nkbihfbeogaeaoehlefnkodbefgpgknn/common-6.js:3:11284)


### Detection stage

In production (default)

### Version

12.0.0

### Build type

None

### Browser

Chrome

### Operating system

MacOS

### Hardware wallet

_No response_

### Additional context

_No response_

### Severity

_No response_
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by team Jul 31, 2024
@github-project-automation github-project-automation bot moved this to To be fixed in Bugs by severity Jul 31, 2024
@metamaskbot metamaskbot added external-contributor regression-prod-12.0.0 Regression bug that was found in production in release 12.0.0 labels Jul 31, 2024
@egorFiNE
Copy link
Author

Additional information: reproducible on all networks, not just BSC.

@danjm
Copy link
Contributor

danjm commented Jul 31, 2024

Thanks @egorFiNE

I have attempted to reproduce this but am not able to. Attached is a video of a successful send of USDT, using version 12 of metamask.

Am I following the same steps that you are following?

usdt-send-v12.mp4

@egorFiNE
Copy link
Author

@danjm I have just recorded a video with the bug reproduction. Can I send it to you by email?

@danjm
Copy link
Contributor

danjm commented Jul 31, 2024

Hey, actually, I think I reproduced it now.

Can you check if the "Show balance and token price checker" toggle in your Settings is off? If so, I think that is required to reproduce this bug.

If you are okay with having that setting turned on, then you can fix the bug by turning the "Show balance and token price checker" setting on, switching networks and then switching back to your desired network.

If you do not want to use MetaMask with that setting turned on, then you will have to wait for us to publish a bug fix.

In any case, please do confirm that setting is toggled off, as it will confirm my understanding of the bug. Thanks again for reporting this and for your help, and sorry for the inconvenience of this bug.

@egorFiNE
Copy link
Author

@danjm yeah, that's it. Toggled it on and it works now.

@anaamolnar anaamolnar added team-assets Sev2-normal Normal severity; minor loss of service or inconvenience. labels Jul 31, 2024
bergeron added a commit that referenced this issue Aug 2, 2024
## **Description**

Fixes an issue when `Show balance and token price checker` is turned off
in settings, certain actions like sending, importing, or swapping a
token crash metamask.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26264?quickstart=1)

## **Related issues**

Fixes: #26243

## **Manual testing steps**

1. Go into settings > security and privacy
2. Turn off `Show balance and token price checker`
3. Switch chains
4. Click import tokens on the tokens tab. Modal should popup without
error
5. Click swap and enter tokens + amount. Swap rate should fetch
successfully.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by team Aug 2, 2024
@github-project-automation github-project-automation bot moved this from To be fixed to Fixed in Bugs by severity Aug 2, 2024
@metamaskbot metamaskbot added the release-12.4.0 Issue or pull request that will be included in release 12.4.0 label Aug 2, 2024
bergeron added a commit that referenced this issue Aug 2, 2024
Fixes an issue when `Show balance and token price checker` is turned off
in settings, certain actions like sending, importing, or swapping a
token crash metamask.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26264?quickstart=1)

Fixes: #26243

1. Go into settings > security and privacy
2. Turn off `Show balance and token price checker`
3. Switch chains
4. Click import tokens on the tokens tab. Modal should popup without
error
5. Click swap and enter tokens + amount. Swap rate should fetch
successfully.

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

<!-- [screenshots/recordings] -->

<!-- [screenshots/recordings] -->

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
dawnseeker8 pushed a commit that referenced this issue Aug 12, 2024
## **Description**

Fixes an issue when `Show balance and token price checker` is turned off
in settings, certain actions like sending, importing, or swapping a
token crash metamask.

[![Open in GitHub
Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/26264?quickstart=1)

## **Related issues**

Fixes: #26243

## **Manual testing steps**

1. Go into settings > security and privacy
2. Turn off `Show balance and token price checker`
3. Switch chains
4. Click import tokens on the tokens tab. Modal should popup without
error
5. Click swap and enter tokens + amount. Swap rate should fetch
successfully.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
@gauthierpetetin gauthierpetetin added release-12.3.0 Issue or pull request that will be included in release 12.3.0 and removed release-12.4.0 Issue or pull request that will be included in release 12.4.0 labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
external-contributor regression-prod-12.0.0 Regression bug that was found in production in release 12.0.0 release-12.3.0 Issue or pull request that will be included in release 12.3.0 Sev2-normal Normal severity; minor loss of service or inconvenience. team-assets type-bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants