Skip to content

Commit 3ebc8a7

Browse files
jclancy93Gudahtt
andauthored
fix: cherry pick swaps undefined object access crash hotfix into v12.4.1 RC (#27757)
## **Description** Cherry picks swaps undefined object access crash hotfix intov12.4.1RC. See [here](#27708) for more info [![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/MetaMask/metamask-extension/pull/27757?quickstart=1) ## **Related issues** https://consensyssoftware.atlassian.net/jira/software/projects/MMS/boards/447/backlog?assignee=5ae37c7e42b8a62c4e15d92a&selectedIssue=MMS-1569 ## **Pre-merge author checklist** - [x] 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). - [x] I've completed the PR template to the best of my ability - [x] I’ve included tests if applicable - [x] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] 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** - [x] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [x] 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. --------- Co-authored-by: Mark Stacey <[email protected]>
1 parent 3d096c2 commit 3ebc8a7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77
## [Unreleased]
88

99
## [12.4.1]
10+
### Fixed
11+
- Fix crash on swaps review page ([27708](https://github.com/MetaMask/metamask-extension/pull/27708))
1012

1113
## [12.4.0]
1214
### Added

ui/pages/swaps/prepare-swap-page/prepare-swap-page.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import {
5252
getTransactionSettingsOpened,
5353
setTransactionSettingsOpened,
5454
getLatestAddedTokenTo,
55+
getUsedQuote,
5556
} from '../../../ducks/swaps/swaps';
5657
import {
5758
getSwapsDefaultToken,
@@ -190,9 +191,10 @@ export default function PrepareSwapPage({
190191
const rpcPrefs = useSelector(getRpcPrefsForCurrentProvider, shallowEqual);
191192
const tokenList = useSelector(getTokenList, isEqual);
192193
const quotes = useSelector(getQuotes, isEqual);
194+
const usedQuote = useSelector(getUsedQuote, isEqual);
193195
const latestAddedTokenTo = useSelector(getLatestAddedTokenTo, isEqual);
194196
const numberOfQuotes = Object.keys(quotes).length;
195-
const areQuotesPresent = numberOfQuotes > 0;
197+
const areQuotesPresent = numberOfQuotes > 0 && usedQuote;
196198
const swapsErrorKey = useSelector(getSwapsErrorKey);
197199
const aggregatorMetadata = useSelector(getAggregatorMetadata, shallowEqual);
198200
const transactionSettingsOpened = useSelector(

0 commit comments

Comments
 (0)