Skip to content

Fix error when fetchParams is null#9757

Merged
Gudahtt merged 1 commit intodevelopfrom
fix-fetch-params-null-error
Oct 29, 2020
Merged

Fix error when fetchParams is null#9757
Gudahtt merged 1 commit intodevelopfrom
fix-fetch-params-null-error

Conversation

@Gudahtt
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt commented Oct 29, 2020

If the swaps state is cleared in between the initial quote fetch and the subsequent poll fetch, a TypeError will be thrown due to
fetchParams being set to null. This is of no functional consequence, as fetchParams should be null in this case, and and no further action should be taken.

The optional chaining operator is now used to ensure the call no longer throws.

If the swaps state is cleared in between the initial quote fetch and
the subsequent poll fetch, a `TypeError` will be thrown due to
`fetchParams` being set to `null`.

This is of no functional consequence, as `fetchParams` _should_ be
`null` in this case, and and no further action should be taken.

The optional chaining operator is now used to ensure the call no longer
throws.
@Gudahtt Gudahtt requested a review from a team as a code owner October 29, 2020 15:43
@Gudahtt Gudahtt requested a review from whymarrh October 29, 2020 15:43
@sentry
Copy link
Copy Markdown

sentry bot commented Oct 29, 2020

Sentry issue: METAMASK-GJPC

Copy link
Copy Markdown
Contributor

@whymarrh whymarrh left a comment

Choose a reason for hiding this comment

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

If it's in Sentry it's a real issue! LGTM!

@metamaskbot
Copy link
Copy Markdown
Collaborator

Builds ready [23aac0f]
Page Load Metrics (437 ± 76 ms)
PlatformPageMetricMin (ms)Max (ms)Average (ms)StandardDeviation (ms)MarginOfError (ms)
ChromeHomefirstPaint298542157
domContentLoaded24770443515976
load24870643715976
domInteractive24770443515976

@Gudahtt Gudahtt merged commit 4086f7b into develop Oct 29, 2020
@Gudahtt Gudahtt deleted the fix-fetch-params-null-error branch October 29, 2020 18:22
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants