Commit fb85c19b authored by Paul Smith's avatar Paul Smith Committed by Jonathan Sacksick
Browse files

Issue #3302354 by MrDaleSmith: Call to a member function isPositive() on null...

Issue #3302354 by MrDaleSmith: Call to a member function isPositive() on null if the order balance is null.
parent ffe8b0b7
Loading
Loading
Loading
Loading
+3 −0
Changes for modules/payment/src/PluginForm/ManualPaymentAddForm.php: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -18,6 +18,9 @@ class ManualPaymentAddForm extends PaymentGatewayFormBase {
    }
    // The payment amount should not exceed the remaining order balance.
    $balance = $order->getBalance();
    if (!$balance) {
      throw new \InvalidArgumentException('The payment amount cannot be determined due to a NULL order balance.');
    }
    $amount = $balance->isPositive() ? $balance : $balance->multiply(0);

    $form['amount'] = [