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

(cherry picked from commit 4543143)
  • Loading branch information
luacmartins authored and OSBotify committed Jun 6, 2024
1 parent 78235dd commit bac8af2
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 @@ -250,9 +250,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 bac8af2

Please sign in to comment.