Commit aef508f5 authored by Dirk Debrunner's avatar Dirk Debrunner
Browse files

#3278371: Check order total not null.

parent c2ae2a5d
Loading
Loading
Loading
Loading
+10 −4
Original line number Diff line number Diff line
@@ -193,10 +193,16 @@ final class ApiManager {
    if (!$orderResponse) {
      $orderResponse = $this->getOrder($order);
    }

    return UnitConverter::toPrice($orderResponse->getOrderAmount(), $order->getTotalPrice()->getCurrencyCode())
      ->equals($order->getTotalPrice());

    // Check if there is a total price on the order.
    // @see https://www.drupal.org/i/3278371.
    $orderTotal = $order->getTotalPrice();
    if ($orderTotal) {
      return UnitConverter::toPrice(
        $orderResponse->getOrderAmount(),
        $order->getTotalPrice()->getCurrencyCode()
      )->equals($order->getTotalPrice());
    }
    return FALSE;
  }

  /**