Skip to content

Commit

Permalink
Merge pull request #43217 from Expensify/Rory-getDefaultMileageRateCrash
Browse files Browse the repository at this point in the history
Fix crash in MoneyRequestConfirmationList
  • Loading branch information
luacmartins authored Jun 6, 2024
2 parents 4679122 + c3d8f36 commit 4543143
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,7 @@ function MoneyRequestConfirmationList({

const policyCurrency = policy?.outputCurrency ?? PolicyUtils.getPersonalPolicy()?.outputCurrency ?? CONST.CURRENCY.USD;

const mileageRate = TransactionUtils.isCustomUnitRateIDForP2P(transaction)
? DistanceRequestUtils.getRateForP2P(policyCurrency)
: mileageRates?.[customUnitRateID] ?? DistanceRequestUtils.getDefaultMileageRate(policy);
const mileageRate = TransactionUtils.isCustomUnitRateIDForP2P(transaction) ? DistanceRequestUtils.getRateForP2P(policyCurrency) : mileageRates?.[customUnitRateID] ?? defaultMileageRate;

const {unit, rate} = mileageRate ?? {};

Expand Down

0 comments on commit 4543143

Please sign in to comment.