Skip to content

Commit

Permalink
Merge pull request #42502 from cretadn22/add-optional-chaining
Browse files Browse the repository at this point in the history
add optional chaining
  • Loading branch information
tgolen authored Jun 3, 2024
2 parents 28673bd + f7f3e71 commit 0d57b7b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function PolicyDistanceRateDetailsPage({policy, route}: PolicyDistanceRateDetail
const currency = rate?.currency ?? CONST.CURRENCY.USD;

// Rates can be disabled or deleted as long as in the remaining rates there is always at least one enabled rate and there are no pending delete action
const canDisableOrDeleteRate = Object.values(customUnit?.rates).some(
const canDisableOrDeleteRate = Object.values(customUnit?.rates ?? {}).some(
(distanceRate: Rate) => distanceRate?.enabled && rateID !== distanceRate?.customUnitRateID && distanceRate?.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE,
);
const errorFields = rate?.errorFields;
Expand Down

0 comments on commit 0d57b7b

Please sign in to comment.