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

fix: issue with 'dappIconUrl' in 'AccountConnect.ts' #8887

Merged
merged 2 commits into from
Mar 12, 2024

Conversation

omridan159
Copy link
Contributor

@omridan159 omridan159 commented Mar 8, 2024

Description

This PR addresses a bug in the AccountConnect.tsx file where an unhandled exception occurs if there are no accounts connected to a dApp.
The issue arises on line 105 due to attempting to access the icon property of originatorInfo on an undefined sdkConnection.

The proposed fix safely accesses originatorInfo by adding an optional chaining operator before originatorInfo, ensuring that the code gracefully handles scenarios where sdkConnection might be undefined.

Screen.Recording.2024-03-08.at.14.06.10.mov

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Before

After

Pre-merge author checklist

  • I’ve followed MetaMask Coding Standards.
  • I've clearly explained what problem this PR is solving and how it is solved.
  • I've linked related issues
  • I've included manual testing steps
  • I've included screenshots/recordings if applicable
  • I’ve included tests if applicable
  • I’ve documented my code using JSDoc format if applicable
  • I’ve applied the right labels on the PR (see labeling guidelines). Not required for external contributors.
  • I’ve properly set the pull request status:
    • In case it's not yet "ready for review", I've set it to "draft".
    • In case it's "ready for review", I've changed it from "draft" to "non-draft".

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.

@omridan159 omridan159 requested a review from a team as a code owner March 8, 2024 14:13
Copy link
Contributor

github-actions bot commented Mar 8, 2024

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.

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 43.23%. Comparing base (9103133) to head (4ef0ecf).

Files Patch % Lines
...components/Views/AccountConnect/AccountConnect.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #8887   +/-   ##
=======================================
  Coverage   43.23%   43.23%           
=======================================
  Files        1271     1271           
  Lines       30905    30905           
  Branches     3088     3088           
=======================================
  Hits        13361    13361           
  Misses      16769    16769           
  Partials      775      775           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dawnseeker8 dawnseeker8 self-requested a review March 9, 2024 00:47
Copy link
Contributor

@dawnseeker8 dawnseeker8 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

sonarcloud bot commented Mar 12, 2024

@omridan159 omridan159 merged commit d47b4ab into main Mar 12, 2024
29 checks passed
@omridan159 omridan159 deleted the fix_issue-in-sdkConnection-AccountConnect branch March 12, 2024 11:06
@github-actions github-actions bot locked and limited conversation to collaborators Mar 12, 2024
@metamaskbot metamaskbot added the release-7.19.0 Issue or pull request that will be included in release 7.19.0 label Mar 12, 2024
@gantunesr gantunesr added team-sdk SDK team and removed team-accounts labels Mar 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.19.0 Issue or pull request that will be included in release 7.19.0 team-sdk SDK team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants