Skip to content

Commit

Permalink
Remove nullsafe operator
Browse files Browse the repository at this point in the history
ISSUE: AD4CR22I-20
  • Loading branch information
filipkojic committed Jan 17, 2025
1 parent 36e590e commit 194557e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Service/ExpressCheckoutService.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ public function getExpressCheckoutConfig(
/** @var ShippingMethodPriceEntity $shippingMethodPriceEntity */
$shippingMethodPriceEntity = $method->getPrices()->first();
/** @var null|Price $price */
$price = $shippingMethodPriceEntity?->getCurrencyPrice()?->first();
$price = null;
if ($shippingMethodPriceEntity && $shippingMethodPriceEntity->getCurrencyPrice()) {
$price = $shippingMethodPriceEntity->getCurrencyPrice()->first();
}
$value = 0;
if ($price) {
$value = $this->currencyUtil->sanitize($price->getGross(), $currency);
Expand Down

0 comments on commit 194557e

Please sign in to comment.